程序猴土木人云土成 2019-10-11 17:15 采纳率: 0%
浏览 471

css二级导航浮动问题,为什么二级导航没有浮动

http://img.mukewang.com/5da0470c0001266411060156.jpg
请问为什么我的二级导航没有浮动起来

http://img2.mukewang.com/5da0462a00010b2309050139.jpg

给定ul宽度的时候才浮起来了 我的一级导航栏不要定宽度也能浮动起来啊这是为什么。哪些错了求解。

<style type="text/css">

li,ul {

list-style: none;

padding: 0;

margin: 0;

}

.nav{

margin-top: 20px;

height: 44px;

background: linear-gradient(114deg,#00d0d4 5%,#00c5c3 51%,#9effa4 100%);

}



.nav .nav_li_div{

position: relative;

height: 44px;

margin: 0 auto;

font-size: 16px;

font-weight: bold;

}



.nav .nav_li_div .nav_li{

position: relative;

float: left;

height: 44px;

width: 60px;

text-align: center;

line-height: 44px;

}



.nav .nav_li_div .nav_li a{

display: block;

height: 44px;

text-decoration: none;

color: white;

}



.nav .nav_li_div .nav_li:hover{

text-decoration: none;

color: white;

background: #00BCD4;

}



.nav .nav_li_div .nav_li_active{

background: #00BCD4;

}



.nav_tag_local{

position: absolute;

top: -10px;

left: 545px;

z-index: 2;

}

.nav .nav_li_div .nav_li .second_nav_div{

background: white;

border: 1px solid #00bcd4;

position: absolute;

height: 44px;

top: 42px;

font-size: 14px;

z-index: 2;

display: block;

/* display: none; */

}



.nav .nav_li_div .nav_li .second_nav_div li{

float: left;

height: 42px;

}



.nav .nav_li_div .nav_li .second_nav_div li a{

font-size: 12px;

text-align: center;

color: #666;

width: 80px;

height: 42px;

display: block;

line-height: 42px;

text-decoration: none;

}



.nav .nav_li_div .nav_li .second_nav_div li:hover{

background: #E0F7FA;

}

</style>

  • 写回答

2条回答 默认 最新

  • 关注
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?