老师请看下是否规范

来源:4-7 编程练习

文龍45

2019-07-05 01:34:04

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>display属性</title>
        <style type="text/css">
          body,div,h3,ul{
              margin:0;
              padding:0;
              font-family:"微软雅黑";
          }
          li{
              list-style:none;
              margin:5px;
              text-align:center;
          }
          .big{
              margin:0 auto;
              width:100px;
          }
          h3{
              background-color:gray;
              border:1px solid black;
              text-align:center;
          }
         ul{
             border:1px solid gray;
             display:none;
         }
         div div:hover ul{
             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-07-05

你好同学,效果实现了,代码也规范。

继续加油哦,祝学习愉快!

0

0 学习 · 40143 问题

查看课程