Left and right align text in 1 horizontal nav bar

Giganews Newsgroups
Subject: Left and right align text in 1 horizontal nav bar
Posted by:  OtisUsenet (otis_usen…@yahoo.com)
Date: 7 May 2007

Hi,

I'm killing myself trying to get a "horizontal nav bar" where some
text is left aligned, and some is aligned to the right, kind of like
this:

LEFT                                          RIGHT
--------------------------------------------------------------

This is what I'm trying:

<div style="background-color: #ccccff; border-bottom: 1px solid
gray;">
  <span style="text-align: left;">LEFT</span>
  <span style="float: right; ">RIGHT</span>
</div>

But what I get looks like this, sort of:

LEFT
--------------------------------------------------------------
                                                    RIGHT

I think I tried all combinations of text-align/float: left/right
without success.

Is there a nice and clean CSS-way to get this right (heh)?

Any help would be very appreciated.  Thanks!

Replies