W3C home > Mailing lists > Public > www-style@w3.org > January 2002

Aligning left/center/right on same line

From: Timothy J. Luoma <luomat@peak.org>
Date: Fri, 4 Jan 2002 13:28:42 -0500
To: "W3 CSS List" <www-style@w3.org>
Message-ID: <EIEJJDNOODKOCHBBKBIJMEKOCKAA.luomat@peak.org>

Sorry if this has been asked before.  Searching the archives doesn't seem to
work.

I'm trying to write HTML4Strict with CSS.

What I would really like to do (and thought I had done before, although I
cannot find any evidence to support that thought) is position text on the
same line which is left-justified, centered, and right-justified.

These would be for simple navigational links, such as:


Previous			Home			Next


Now what I have tried to do for this is

.inlineleft { display: inline;
			text-align: left }

.inlineright { display: inline;
			text-align: right }

.inlinecenter { display: inline ;
			text-align: right }

and then coding it like this:

<span class="inlineleft">Previous</span>
<span class="inlinecenter">Center</span>
<span class="inlineright">Next</span>

The resulting HTML validates, as does the CSS, but the links are all left
justified (Opera 5 & 6, IE 6, Mozilla, and Netscape 6... I didn't try
Netscape 4 ;-)

I also tried <div class=... instead of <span class=...


1) Is this the right way to do this?


2) Is there another way to get this to work in existing browsers?


TjL
Received on Friday, 4 January 2002 13:29:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:12 GMT