Alex Rivera | Logout

How do I make a HTML div go under another div?

Asked 2011-06-07T15:58:08.337
21
<html>
<body>
<div id="content1">
    <div id="text1">This text floats left</div>
    <div id="images1"><img src="img.jpg" /></div> <!--Floats right-->
</div>
<div id="content2">Text 2</div>
</body>
</html>

When I try to do this, and try to make a layout like a table with two rows with the text floating left and the image floating right in the top row, all that comes up is that the content2-div is squashed into the content1-div. How can I keep them separate?

Edit
Report

2 Answers

24

You need to use clear:both; on your #content2 div

If you really wanna learn everything about floats, check out this amazing tutorial: http://css.maxdesign.com.au/floatutorial/

answered 2011-06-07T15:59:39.047
2

Use clear:both; on your content#2

answered 2011-06-07T16:00:24.477

Your Answer