How to place a div next to another div without starting a new row

In order to do this you must use the style attribute “float”. In your style sheet, you can do the following, if your div is named box1.( div id=”box1″ and div id=”box2″)…

#box1 { float: left; width:250px;}
#box2 { float:left; width:300px;}

You must set a width, and you can float them left or right, as many divs as you like, and they will stack next to eachother. What they do not tell you is right after the stacked divs, you must enter a CLEAR attribute to a new blank div. As follows…

div style=”clear: both;”

This stops the side by side setting so you can continue down the page.

That’s it! Now you do not have to use tables anymore. You can add padding and heights to the divs instead.

Contact Us

Contact Us
First
Last

Island Blue Design

1829 Reisterstown Road
Suite 350
Pikesville, MD 21208