I have 4 div
s, one outer, and 3 inner div
s that I want to align in the same row inside the main div
. By default the div
s 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 div
s no longer appear inside the main div
. How can I line up the 3 div
s 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>