首页 > 代码库 > CSS清除浮动
CSS清除浮动
参考一:From http://www.bitscn.com/school/HTMLCSS/201312/284207.html
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clearfix {display: inline-block;} /* for IE/Mac */ </style> <!--[if IE]> <style type="text/css"> .clearfix {zoom: 1;/* triggers hasLayout */ display: block;/* resets display for IE/Win *
参考二:http://www.jb51.net/css/67471.html
/* For modern browsers */ .cf:before,.cf:after { content:""; display:table; } .cf:after { clear:both; }/* For IE 6/7 (trigger hasLayout) */ .cf { zoom:1; }
参考三:from http://www.cnblogs.com/iloveyoucc/archive/2012/09/17/2688962.html
清除浮动方法:1. .overflow1{overflow:hidden;zoom:1;}2. .clearfix{display:block;}.clearfix:after{ clear: both; content: "."; display: block; height: 0; visibility: hidden;}
CSS清除浮动
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。