• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

为什么hover设置给.nav-li就能显示二级菜单,而设置给tit就不行

为什么hover设置给.nav-li就能显示二级菜单,而设置给tit就不行,而且二级菜单都是一个class类,hover怎么知道显示的是哪个一级菜单下的二级菜单,如果这样写,不应该是当鼠标移到一个1级菜单下时,所有的二级菜单都应该被显示吗









   
    position
   
    * {
        padding: 0;
        margin: 0;
    }


    .page {
        width: 100%;
        height: 4043px;
        background: url("mooc.png") center top no-repeat;
    }


    .nav {
        width: 160px;
        height: 205px;
        position: fixed;
        left: 0;
        top: 50%;
        margin-top: -103px;
        font-family: 'Miscrosoft YaHei';
    }


    .nav-li {
        width: 160px;
        height: auto;
        border-bottom: 1px solid #FFF;
        background: #333;
        text-align: center;
        line-height: 40px;
        color: #FFF;
        font-size: 16px;
        cursor: pointer;
    }


    .tit {
        width: 160px;
        height: 40px;
    }


    .tit:hover ul {
        display: block;
    }


    .nav-li ul {
        width: 160px;
        height: auto;
        background: #FFF;
        display: none;
    }


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


    .nav-li ul li:hover .list-3 {
        display: block;
    }


    .list-3 {
        width: 160px;
        height: auto;
        position: absolute;
        left: 160px;
        top: 0px;
        display: none;
    }


    .list-3Dom {
        width: 160px;
        height: 40px;
        background: #444;
        border-bottom: 1px solid #FFF;
        text-align: center;
        line-height: 40px;
        color: #FFF;
    }
   




   
        
            
                慕课网的标题

               

                        

  •                         二级栏目
                            
                                三级栏目

                                三级栏目

                                三级栏目

                            


                        

  •                         二级栏目
                            
                                三级栏目

                                三级栏目

                                三级栏目

                            


                        

  •                         二级栏目
                            
                                三级栏目

                                三级栏目

                                三级栏目

                            


                   

            

            
                慕课网的标题

               

                        

  •                         二级栏目

                        

  •                         二级栏目

                        

  •                         二级栏目

                   

            

            
                慕课网的标题

               

                        

  •                         二级栏目

                        

  •                         二级栏目

                        

  •                         二级栏目

                   

            

            
                慕课网的标题

               

                        

  •                         二级栏目

                        

  •                         二级栏目

                        

  •                         二级栏目

                   

            

            
                慕课网的标题

               

                        

  •                         二级栏目

                        

  •                         二级栏目

                        

  •                         二级栏目

                   

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

全部参与1

首页你要理解hover的含义先,hover样式写肯定是对于下一层,因为你的tit跟二级菜单是同级的关系,用css去写hover肯定是实现不了的,如果你一定要tit可以借助js去写呀

使用道具 举报

发新帖

发布任务需求已有1031167位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!