4-2案例中实际操作遇到的问题

4-2案例中实际操作遇到的问题

<<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>position</title>

<style type="text/css">

     

       *{

        padding: 0px;

        margin:0px;

       }

      .big{

        width:160px;

        height: 205px;

        border-bottom: 1px dotted #ececec;

        position:fixed;

        background-color: black;

        left: 0;

        top:50%;

        margin-top:-103px; 

        font-family:"微软雅黑";

      }


      .menue{

       width::160px;

       height:auto;

       border-bottom: 1px solid #ececec;

       line-height:40px;

       background-color: #333;

       text-align:center;

       color: #fff;

       font-size:16px;

      }


      .list1{

       width: 160px;

       height:auto;

      }


      .menue ul{

       width: 160px;

       height: auto;

       background: #ececec;

       display: none;

      }

      .menue ul li{

       width: 160px;

       height: 40px;

       border-bottom: 1px dotted #666;

       line-height: 40px;

       color: orange;

       text-align: center;

       position: relative;



      }


      .menue:hover ul{

       display: block;

      }


      .menue ul li:hover .list3{

       display: block;

      }


      .list2{

       width: 160px;

       height: auto;

      }


      .list3{

       width: 160px;

       height: 40px;

       text-align: center;

       line-height: 40px;

       border-bottom: 1px dashed red;

       color:pink;

       position: absolute;

       left: 160px;

       top: 0;

       display: none;

       background:#000;


      }


</style>

</head>

<body>

<div class="perent">

<div class="big">

        <div class="menue">

                 <div class="list1">目录</div>

                 <ul>

                      <li>22222222</li>

                         <div class="list2">

                           <div class="list3">33333</div>

                           <div class="list3">33333</div>

                           <div class="list3">33333</div>

                         </div>

                      <li>222222222</li>

                      <div class="list2">

                           <div class="list3">33333</div>

                           <div class="list3">33333</div>

                           <div class="list3">33333</div>

                 </ul>

        </div>

             

 <div class="menue">目录</div>

 <div class="menue">目录</div>

 <div class="menue">目录</div>

 <div class="menue">目录</div>

                 

</div>

</div>

</body>

</html>

两个问题:

1、为何3个3级标题只显示1个?

2、为何hover效果在3级标题中没做到?

正在回答

登陆购买课程后可参与讨论,去登陆

1回答
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>position</title>
<style type="text/css">
     
       *{
        padding: 0px;
        margin:0px;
       }
      .big{
        width:160px;
        height: 205px;
        border-bottom: 1px dotted #ececec;
        position:fixed;
        background-color: black;
        left: 0;
        top:50%;
        margin-top:-103px; 
        font-family:"微软雅黑";
      }

      .menue{
       width::160px;
       height:auto;
       border-bottom: 1px solid #ececec;
       line-height:40px;
       background-color: #333;
       text-align:center;
       color: #fff;
       font-size:16px;
      }

      .list1{
       width: 160px;
       height:auto;
      }

      .menue ul{
       width: 160px;
       height: auto;
       background: #ececec;
       display: none;
      }

      .menue ul li{
       width: 160px;
       height: 40px;
       border-bottom: 1px dotted #666;
       line-height: 40px;
       color: orange;
       text-align: center;
       position:relative;
      }

      .menue:hover ul{
       display: block;
      }
      
      .menue ul li:hover .list3{
        display:block;
      }
      
      .list2{
       width: 160px;
       height: auto;
       position:absolute;
       left:160px;
       top:0px;
       
      }

      .list3{
       width: 160px;
       height: 40px;
       text-align: center;
       line-height: 40px;
       border-bottom: 1px dashed red;
       color:pink;
       background:#000;
       display:none;
      }


</style>
</head>
<body>
<div class="perent">
<div class="big">
        <div class="menue">
                 <div class="list1">目录</div>
                 <ul>
                      <li>22222222
                         <div class="list2">
                           <div class="list3">33333</div>
                           <div class="list3">33333</div>
                           <div class="list3">33333</div>
                         </div>
                      </li>   
                      <li>222222222
                      <div class="list2">
                           <div class="list3">33333</div>
                           <div class="list3">33333</div>
                           <div class="list3">33333</div>
                      </li>     
                 </ul>
        </div>
             
 <div class="menue">目录</div>
 <div class="menue">目录</div>
 <div class="menue">目录</div>
 <div class="menue">目录</div>
                 
</div>
</div>
</body>
</html>

ul中的li列表项的结束符号位置写错了,参照我的答案,可以完美解决你的问题。

  • 八千里鹿 提问者 #1
    不够细心,谢谢你!
    2017-06-03 09:00:41
  • 八千里鹿 提问者 #2
    然而。。还是只显示一个3级标题、、
    2017-06-04 19:47:41
  • 小于飞飞 回复 提问者 八千里鹿 #3
    你好,你说的是,只有第一个显示 3 级标题;还是第一个 显示的三级标题只有一个。
    2017-06-04 22:18:07
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师