Click to See Complete Forum and Search --> : Float not working?


stmasi
04-02-2004, 12:24 PM
I'm trying to achieve the following:

FLOAT.LEFT.DIV.|.FLOAT.RIGHT.DIV

However, for whatever reason, I'm coming up with this:

FLOAT.LEFT.DIV.|
.......................|.FLOAT.RIGHT.DIV

What the heck am I doing wrong?
What would be the proper HTML / CSS code?

I currently have this:

HTML
----------
<div id="left"></div>
<div id="right"></div>

CSS
----------
#left { float:left; margin-right:130px; }
#right { float:right; width: 125px; }

Am I missing something?

Thanx.

gil davis
04-02-2004, 01:40 PM
A DIV is a block object, and that will force a hard return. Use SPAN instead.

ray326
04-02-2004, 05:07 PM
The #left div is too wide. Try something like this

#left { float:left; width:65%; background:#f00; }
#right { float:right; width: 30%; background:#0f0;}