微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

html卡通风景简单代码HTML卡通风景简单代码

HTML卡通风景简单<a href="/tag/daima/" target="_blank" class="keywords">代码</a>

HTML卡通风景简单代码

下面是一段HTML代码,实现了一副卡通风景的图片

      
        <!DOCTYPE html>
        <html>
          <head>
            <title>卡通风景</title>
            <style>
              #sky {
                width: 100%;
                height: 50%;
                background-color: #D4F4FB;
              }
              #sun {
                position: relative;
                top: 5%;
                left: 5%;
                width: 10%;
                height: 20%;
                background-color: #F0E68C;
                border-radius: 50%;
              }
              #grass {
                width: 100%;
                height: 50%;
                background-color: #90EE90;
              }
              #tree {
                position: relative;
                top: -20px;
                left: 60%;
                width: 20%;
                height: 50%;
                background-color: #8B4513;
                border-radius: 0 0 20% 20%;
              }
              #tree:before,#tree:after {
                content: "";
                position: absolute;
                top: -40px;
                left: -80px;
                width: 200%;
                height: 100%;
                background-color: #8B4513;
                border-radius: 50%;
              }
              #tree:after {
                top: -80px;
                left: -40px;
              }
            </style>
          </head>
          <body>
            <div id="sky"></div>
            <div id="sun"></div>
            <div id="grass"></div>
            <div id="tree"></div>
          </body>
        </html>
      
    

html卡通风景简单代码

使用HTML和CSS可以轻松制作出卡通风景图案,通过调整属性可以实现更多不同的效果

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐