I have one content div in body and inside that div I need three horizontal divs, one next another. I tried with float: left, float right and with fixed widths but it doesn't work. How I can do that ?
+1
A:
float:left
should work fine. Here is a demo
<style type="text/css">
#box {float:left;border:1px solid}
</style>
<div id="container">
<div id="box">This is box 1.</div>
<div id="box">This is box 2.</div>
<div id="box">This is box 3.</div>
</div>
irishbuzz
2010-10-18 13:08:09
Thanks, it's works !
Dayanna
2010-10-18 14:00:21
A:
/* new clearfix */
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
* html .clearfix { zoom: 1; } /* IE6 */
*:first-child+html .clearfix { zoom: 1; } /* IE7 */
.clearfix div {
float : left;
width : 33.3%;
}
<div class="clearfix">
<div>1</div>
<div>2</div>
<div>3</div>
</div>
Clearing: http://perishablepress.com/press/2009/12/06/new-clearfix-hack/
Fabrizio Calderan
2010-10-18 13:10:47