Home > Web Front-end > HTML Tutorial > Add float attribute to li and jump out of div layer_html/css_WEB-ITnose

Add float attribute to li and jump out of div layer_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:25:34
Original
1417 people have browsed it

After adding the float attribute to li, the label displayed in li jumps out of the div box. Why is this?



#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;
}


Reply to discussion (solution)

google - > Closed floating element

#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
}

If it doesn’t work, just use positioning

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template