最近我查看了一些网站的代码,发现每个人<div> 都有一个班级clearfix.
经过快速谷歌搜索,我了解到它有时适用于IE6,但实际上是什么是一个clearfix?
与没有clearfix的布局相比,您能提供一些带有clearfix的布局示例吗?
我得到以下代码:https: //jsfiddle.net/2uhttdgk/3/
html {
height: 100%;
}
html, body {
min-height: 100% !important;
/* prevent horizontal scrolling */
max-width: 100% !important;
overflow-x: hidden !important;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#menuButton {
float:left;
background-image: url("../images/hamburger_menu.png");
width: 50px;
height: 40px;
margin-right: 5px;
}
#powerButtonBox {
float: right;
}
#outerBox {
min-height: 100%;
height: auto !important;
height: 100%;
}
#title {
background: #E95353;
padding: 10px;
color: white;
font-size: x-large;
}
#outerBox {
width: 100%;
height: 100%;
}
.nav a …Run Code Online (Sandbox Code Playgroud)