老师您好,帮我看下这里代码规范方面,有没有哪里有问题需要优化的?

来源:4-7 编程练习

weixin_慕的地431107

2019-05-15 13:20:54

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>display属性</title>
        <style type="text/css">
          /*样式补充*/
            *{
              margin: 0px;
              padding: 0px;
            }

            ul{
            list-style:none;
            display: none;
            }
            /*li{display: none;}*/
            div{
                border: 1px solid #d1c7b7;
            }
            h3{
                border-bottom: 1px solid #d1c7b7;
                background-color: #d9d6c3;
                text-align: center;
            }
            .big{width: 150px;
                margin: 0px auto;
                margin-top: 200px;
            }
            .elec,.wash,.clothes{
                padding-left:60px;
                letter-spacing: 0.5em;
            }
            .div1:hover .elec,.div2:hover .wash,.div3:hover .clothes{
                display: block;
            }
        </style>
    </head>
    <body>
    <div class="big">
        <div class="div1">
            <h3>家电</h3>
            <ul class="elec">
                <li>冰箱</li>
                <li>洗衣机</li>
                <li>空调</li>
            </ul>
        </div>
        <div class="div2">
            <h3>洗护</h3>
            <ul class="wash">
                <li>洗衣液</li>
                <li>消毒液</li>
                <li>柔顺剂</li>
            </ul>
        </div>
        <div  class="div3">
            <h3>衣物</h3>
             <ul class="clothes">
                <li>衬衫</li>
                <li>裤子</li>
                <li>卫衣</li>
            </ul>
        </div>
      </div>
</body>
</html>


写回答

1回答

好帮手慕糖

2019-05-15

同学你好,实现效果没有问题,代码也是可以的哦,继续加油!

祝学习愉快!

0

0 学习 · 40143 问题

查看课程