Heim  >  Artikel  >  Web-Frontend  >  给li加上float属性后跳出div层_html/css_WEB-ITnose

给li加上float属性后跳出div层_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:25:341371Durchsuche

给li加了float属性以后 li显示的标签跳出了div框,这是为什么?


给li加上float属性后跳出div层_html/css_WEB-ITnose



#quyu1 .l .fenlei_menu {
width: 191px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #666666;
border-right-color: #666666;
border-bottom-color: #666666;
border-left-color: #666666;
height: auto;
}


#quyu1 .l a {
font-size: 12px;
color: #666666;
}
#quyu1 .l .fenlei_menu h2 {
padding-top: 7px;
padding-left: 18px;
color: #009966;
}

#quyu1 .l .fenlei_menu ul {
padding-left: 18px;
height: auto;
}
#quyu1 .l .fenlei_menu ul li {
width: 48%;
padding-top: 13px;
float: left;
}




#quyu1 .l {
width: 193px;
overflow: hidden;
float: left;
}

回复讨论(解决方案)

google -> 闭合浮动元素

#quyu1 .l .fenlei_menu {
width: 191px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #666666;
border-right-color: #666666;
border-bottom-color: #666666;
border-left-color: #666666;
height: auto;
zoom:1;overflow:auto
}

实在不行就用定位呗 

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn