I have 4 divs, one outer, and 3 inner divs that I want to align in the same row inside the main div. By default the divs are stacked one on top of another inside the main div, so I used float to make them appear in a row.
But once adding float, the divs no longer appear inside the main div. How can I line up the 3 divs inside that main div using CSS?
<div id="main" style="border: solid 1px black;float:left;">
<div id="left" style="border: solid 1px red;">
Left
</div>
<div id="middle" style="border: solid 1px green;">
Middle
</div>
<div id="right" style="border: solid 1px blue;">
Right
</div>
</div>