zoom:1和overflow:auto清除浮动

来源:互联网 发布:攻城掠地神兵锻造数据 编辑:程序博客网 时间:2024/05/20 09:45
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>MJBlog</title><style type="text/css">.box{      width:300px; height:auto; background-color: #000000; margin:100px auto; padding:5px; }.box h2{ width:300px; line-height:24px; color:#CCCCCC;} .xx { width:140px; float:left; height:24px; overflow:hidden; padding:0px 5px; line-height:24px; color: #FF9933;}.za{overflow:auto; zoom:1}.zb{overflow:auto;}.zc{zoom:1;}   </style></head><body><div class="box"><h2>这个没加overflow:auto和zoom:1属性,没有清除浮动,底下的li产生溢出重叠现象</h2><div class="xx">福州酒吧万圣节派对活动</div><div class="xx">福州酒吧万圣节派对活动</div><div class="xx">福州酒吧万圣节派对活动</div><div class="xx">福州酒吧万圣节派对活动</div><div class="xx">福州酒吧万圣节派对活动</div><div class="xx">福州酒吧万圣节派对活动</div></div><div class="box za"><h2>这个加overflow:auto和zoom:1属性,清除浮动,正常</h2><div class="xx">福州酒吧万圣节派对活动</div><div class="xx">福州酒吧万圣节派对活动</div><div class="xx">福州酒吧万圣节派对活动</div><div class="xx">福州酒吧万圣节派对活动</div><div class="xx">福州酒吧万圣节派对活动</div><div class="xx">福州酒吧万圣节派对活动</div></div></body></html>

0 0