http://codepen.io/willc86/pen/hpFLe爲中心的CSS DIV,具有中間
嗨我在上面的代碼筆鏈接,這樣你們可以看到它的問題。我很困擾中間盒子的問題。我怎麼做。當我不居中,中間的方框似乎有利於一方,當我縮小瀏覽器的
這是我的代碼
#box{
border: 3px solid red;
}
#space{
text-align: center;
}
#leftcolumn {
width: 300px; border: 1px solid red; float: left; margin: 40px;
margin-right: 20px;
}
#rightcolumn {
width: 300px; border: 1px solid red; float: right;
margin: 40px; margin-left: 20px;
}
#mcolumn {
width: 300px; border: 1px solid red; float: left; margin: 40px;
}
.clear {
clear: both;
}
和我的HTML
<div id="box">
<div id="space">
<div id="leftcolumn"><p>LEFT</p></div>
<div id="rightcolumn"><p>RIGHT</p></div>
<div id="mcolumn"><p>mcolomn</p></div>
<div class="clear"></div>
</div>
</div>