`
ant04444
  • 浏览: 22085 次
  • 性别: Icon_minigender_1
  • 来自: 广州
最近访客 更多访客>>
社区版块
存档分类
最新评论

css fix

    博客分类:
  • css
 
阅读更多
come from http://www.webtoolkit.info/css-clearfix.html


CSS clearfix
The problem happens when a floated element is within a container box, that element does not automatically force the container’s height adjust to the floated element. When an element is floated, its parent no longer contains it because the float is removed from the flow. You can use 2 methods to fix it:

{clear: both;}
clearfix


Once you understand what is happening, use the method below to “clearfix” it.
DEMO

Source code for webtoolkit.clearfix.css
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}

.clearfix {
display: inline-block;
}

html[xmlns] .clearfix {
display: block;
}

* html .clearfix {
height: 1%;
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics