- I have one container div, which contains 3 divs inside it.
- When i write border:1px solid red for container div, border is shown only on top of these 3 child divs, but not around them.
Below is css code.
#cont { width:800px; margin-right:auto; margin-left:auto; border:1px dashed red; padding:2px; } #third, #second, #first { width:260px; float:left; margin:2px; }
Html code:
![<div id="cont"> <div id="third"><p>A demo text </p></br> <p>A demo text </p></br> <p>A demo text </p></br> <p>A demo text </p></br> </div> <div id="second"><p>A demo text </p></br> <p>A demo text </p></br> <p>A demo text </p></br> <p>A demo text </p></br> </div> <div id="third"><p>A demo text </p></br> <p>A demo text </p></br> <p>A demo text </p></br> <p>A demo text </p></br> </div> </div>][1]
<div style="clear: both;"></div>that most likely will do the trick