0
的明確都需要我有這樣的CSS
代碼:CSS:在不同級別的div
#header {
width: 100%;
background: yellow;
}
#content {
width: 100%;
}
#col1 {
width: 200px;
float: left;
background: red;
}
#col2 {
width: 600px;
background: yellow;
margin: 0px 0px 0px 200px;
}
#col3 {
width: 200px;
float: right;
background: blue;
}
#footer {
width: 100%;
height: 90px;
background: black;
clear: both; **<~ This**
}
HTML
代碼:
<div id="header"></div>
<div id="content">
<div id="col1"></div>
<div id="col2"></div>
<div id="col3"></div>
</div>
<div id="footer"></div>
問: 是在propertie clear: both
需要在footer
中的情況下, footer
與colx
(col1,col2,col3)有什麼不同?
無需明確。只需添加overflow:auto或隱藏到#content。 –