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

CSS width property

From: Timo Frenay <timo@followyourdreams.nl>
Date: Sun, 23 Jan 2005 14:51:05 +0100
Message-ID: <41F3ABC9.2040709@followyourdreams.nl>
To: www-style@w3.org

Hello,

I am new to this list and I am desperate for an answer to my question. 
Ideally, setting the width, margin-left and margin-right properties on a 
block-level element to auto would create a centered box that sizes to 
its contents. Instead, all browsers that I know of default the width to 
100% if it is not set explicitly, and only tables and floating elements 
size to their contents. Floating has its own problems though, and 
{display: table} doesn't work in MSIE/Win. Is there any reliable way to 
make an element size to its contents without resorting to floating? 
Thanks in advance.

Greetings,
Timo Frenay.
Received on Sunday, 23 January 2005 15:18:17 GMT

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