W3C home > Mailing lists > Public > www-style@w3.org > July 2001

How do I center a block?

From: ┼smund SkjŠveland <aasmunds@student.matnat.uio.no>
Date: Sun, 8 Jul 2001 23:03:34 +0200
To: www-style@w3.org
Message-ID: <20010708230334.F19618@unity.copyleft.no>
I am trying to mke a nice menu for my webpage. I'm using the menu at 
http://www.w3.org/Style/Examples/007/menus.html  as a basis for the visual
model, but I want it centered horizontally and vertically.
I see that I can achieve centering by explitly setting 'left' and 'right' to
the same value, but then I lose all control of the width of the menu.

How do I center a block? I see that there's a property 'vertical-align', but
it does not appear to apply to blocks.

I want to do my layout entirely in CSS (using HTML 4.01 Strict), so 
<div align=center> is not an option.

Your help is greatly appreciated.

-- 
┼smund SkjŠveland (aasmunds@student.matnat.uio.no)
Received on Sunday, 8 July 2001 17:03:37 GMT

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