tags:

views:

14

answers:

1

In the html below I want the third div so that it is in the same row as the first two but with a 100px gap inbetween. The code displays the first two divs adjacent which is what i want but then the third div is displayed underneath the first two. Changing the style of the first two divs to something other than float left messes up the rest of the page.

Any ideas?

<div class="maintitle">

<div style="float: left;">
</div>
<div style="float: left;">
</div>
<div style="float: left; margin-left: 100px;">
</div>

</div>
A: 

Change all the float: left; declarations to display: inline-block; and you should be good to go.

Delan Azabani
Still leaves it underneath.
David Willis
Works perfectly fine for me.
Delan Azabani
Example: http://azabani.com/misc/stackoverflow/3741064-test
Delan Azabani
Sorry, working now. The width of the container was set too small. Thank you!!
David Willis
No problem. Accept my answer? ;)
Delan Azabani
Accepted.............
David Willis