使用html+css画出你心中夏天的感觉

夏天常常与阳光、蓝天、白云、绿树、海滩、和清凉的水等元素相关联。以下是一个简单的HTML和CSS示例,用于描绘我心中的夏天感觉:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Summer Feel</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: Arial, sans-serif;
            background-color: #f0f3bd; /* 浅绿色背景 */
        }

        .container {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            text-align: center;
            color: #333;
        }

        .sun {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 100px;
            height: 100px;
            background-color: gold; /* 金色太阳 */
            border-radius: 50%;
            box-shadow: 0 0 50px gold; /* 太阳光芒 */
        }

        .cloud {
            position: absolute;
            left: 50%;
            top: 30%;
            width: 200px;
            height: 80px;
            background-color: #fff; /* 白云 */
            border-radius: 50%;
            box-shadow: -50px 0 0 #fff, 50px 0 0 #fff;
            transform: translateX(-50%);
        }

        .tree {
            position: absolute;
            bottom: 20px;
            left: 20px;
            width: 150px;
            height: 200px;
            background-color: #228B22; /* 绿树 */
            clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
        }

        .sea {
            position: absolute;
            bottom: 0;
            width: 100%;
            height: 30%;
            background-color: #0080ff; /* 海水 */
        }

        .wave {
            position: absolute;
            bottom: -5%;
            left: 50%;
            width: 150%;
            height: 150%;
            background-repeat: repeat no-repeat;
            background-size: 50% 100%;
            background-image: radial-gradient(circle at 50% 50%, transparent 35%, #0080ff 36%);
            animation: wave 3s linear infinite;
        }

        @keyframes wave {
            0% {
                transform: rotate(0deg) translateX(-50%);
            }
            100% {
                transform: rotate(360deg) translateX(-50%);
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="sun"></div>
        <div class="cloud"></div>
        <div class="tree"></div>
        <div class="sea">
            <div class="wave"></div>
        </div>
        <h1>Welcome to Summer!</h1>
    </div>
</body>
</html>

这个示例使用HTML和CSS创建了一个包含太阳、白云、绿树、海水和波浪的简单夏天场景。你可以根据自己的喜好调整颜色、大小和位置等属性,以更好地表达你心中的夏天感觉。

posted @   王铁柱6  阅读(9)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗
点击右上角即可分享
微信分享提示