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

Re: Aligning left/center/right on same line

From: fantasai <fantasai@escape.com>
Date: Fri, 04 Jan 2002 17:31:15 -0500
Message-ID: <3C362D33.D00167C4@escape.com>
To: www-style@w3.org
"Timothy J. Luoma" wrote:
> 
> 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

Try using floats

#nav-links {
  text-align: center;
}
#prev {
  float: left;
}
#next {
  float: right;
}

<div id="nav-links">
  <a href="..." id="prev">Previous</a>
  <a href="..." id="next">Next</a>
  <a href="..." id="home">Home</a>
</div>

Authoring questions, btw, should be addressed to
comp.infosystems.www.authoring.stylesheets
Received on Friday, 4 January 2002 17:28:22 GMT

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