Home >Web Front-end >HTML Tutorial >Some tips on using float attributes_html/css_WEB-ITnose
html:<div class="leftdiv"><ul class="link"> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li></ul></div>css:.leftdiv{width:260px;}.link li{ float: left; margin-right: 4px; margin-top: 4px; width:118px;}
Cause: If the containing block is too narrow to accommodate horizontally arranged floating elements, then the other floating blocks move down until there are Space place.