利用HTML5+CSS3绘制HTML5的LOGO

示例代码:

本项目是由div块级元素拼接而成,用CSS样式控制每一块的样式和位置。


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML5的logo设计</title>
    <style>
        body{
            margin:0;
            padding:0;
        }
        div{
            position:absolute;
        }
        .bg{
            width: 8000px;
            height:6000px;
            background:#f2f2f2;
            overflow: hidden;
        }
        .beam{
            width:1600px;
            height:20px;
            background:#fff;
            top:290px;
            left:-400px:
        }
        .d_shield1,.d_shield2 ,.d_shield3,.d_shield3 ,.d_shield4 ,.d_shield5 ,.d_shield6 ,.d_shield7  {
            background:#e15016;
        }
        .d_shield1 {
            left:32px;
            width:140px;
            height:346px;
        }
        .d_shield2 {
            transform: skewx(5deg);
            left:16px;
            width:100px;
            height:346px;
        }
        .d_shield3 {
            transform: skewy(15deg);
            top:265px;
            left:32px;
            width:140px;
            height:100px;
        }
        .d_shield4 {
            left:172px;
            width:140px:
            height:346px;
        }
        .d_shield5 {
            transform :skewX(-5deg) ;
            left :227px;
            width:100px;
            height:346px;
        }
        .d_shield6 {
            transform:skewY(-15deg) ;
            top:265px;
            left:172px;
            width:140px;
            height:100px;
        }
        .d_shield7 {
            height:20px;
            top:199px;
            width:80px;
            left:60px;
        }
        .l_shield1 ,.l_shield2 ,.l_shield3 ,.l_shield4 {
            background:#ee6812;
        }
        .l_shield1 {
            left:172px;
            width:140px;
            height:346px;
        }
        .l_shield2 {
            transform:skewX(-5deg) ;
            left:227px;
            width:100px;
            height:363px;
        }
        .l_shield3 {
            transform:skewY(-15deg) ;
            top:282px;
            left:172px;
            width:138px;
            height:100px;
        }
        .l_shield4 {
            height:43px;
            top:113px;
            width:100px;
            left:180px;
        }
        .gray1,.gray2,.gray3,.gray4{
            background:#ebebeb;
        }
        .gray1 {
            height:43px;
            width:102px;
            left:70px;
            top:70px;
        }
        .gray2 {
            width:46px;
            height:210px;
            transform:skewX(5deg) ;
            top:70px;
            left:75px;
        }
        .gray3 {
            width:95px;
            height:43px;
            left:77px;
            top:156px;
        }
        .gray4 {
            width:87px;
            height:47px;
            left:85px;
            top:251px;
        }
        .white1,.white2,.white3,.white4{
            background:#fff;
        }
        .white1 {
            width:102px;
            height:43px;
            left:172px;
            top:70px;
        }
        .white2 {
            width:46px;
            height:216px;
            transform:skewx(-5deg);
            left:223px;
            top:70px;
        }
        .white3 {
            height:43px;
            width:95px;
            left:172px;
            top:156px;
        }
        .white4 {
            width:87px;
            height:47px;
            left:172px;
            top:251px;
            tansform:skewy(-15deg);
        }
        img{
            position:fixed;
            top:-190px;
            left:-120px;
            width:225px
            height:165px;
        }
    </style>
</head>
<body>
<div class="bg">
    <div class="beam" style="transform:rotate(5deg) "></div>
    <div class="beam" style="transform:rotate(15deg) "></div>
    <div class="beam" style="transform:rotate(25deg) "></div>
    <div class="beam" style="transform:rotate(35deg) "></div>
    <div class="beam" style="transform:rotate(45deg) "></div>
    <div class="beam" style="transform:rotate(55deg) "></div>
    <div class="beam" style="transform:rotate(65deg) "></div>
    <div class="beam" style="transform:rotate(75deg) "></div>
    <div class="beam" style="transform:rotate(85deg) "></div>
    <div class="beam" style="transform:rotate(95deg) "></div>
    <div class="beam" style="transform:rotate(105deg) "></div>
    <div class="beam" style="transform:rotate(115deg) "></div>
    <div class="beam" style="transform:rotate(125deg) "></div>
    <div class="beam" style="transform:rotate(135deg) "></div>
    <div class="beam" style="transform:rotate(145deg) "></div>
    <div class="beam" style="transform:rotate(155deg) "></div>
    <div class="beam" style="transform:rotate(165deg) "></div>
    <div class="beam" style="transform:rotate(175deg) "></div>
<div class="logo" style="top:120px;left:630px">
    <div class="d_shield1"></div>
    <div class="d_shield2"></div>
    <div class="d_shield3"></div>
    <div class="d_shield4"></div>
    <div class="d_shield5"></div>
    <div class="d_shield6"></div>
    <div style="transform:scale(0.82);left:31px;top:25px;">
        <div class="l_shield1"></div>
        <div class="l_shield2"></div>
        <div class="l_shield3"></div>
        <div class="gray1"></div>
        <div class="gray2"></div>
        <div class="gray3"></div>
        <div class="gray4"></div>
        <div class="white1"></div>
        <div class="white2"></div>
        <div class="white3"></div>
        <div class="white4"></div>
        <div class="d_shield7"></div>
        <div class="l_shield4"></div>
        <div class="img" >
            <img src="HTML.png"/>
        </div>
    </div>
</div>
</div>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值