W3C home > Mailing lists > Public > www-style@w3.org > March 2003

Re: Block element width behavior

From: Jim Dabell <jim-www-style@jimdabell.com>
Date: Fri, 14 Mar 2003 22:32:37 +0000
To: www-style@w3.org
Message-Id: <200303142232.37387.jim-www-style@jimdabell.com>

On Friday 14 March 2003 10:26 pm, Stuart Ballard wrote:

[no way of making block elements 'auto' width]

> I don't object to this default behavior, but the problem is that as far
> as I can tell there's NO WAY to style a div to behave like the table
> cell does by default. Which forces me to use horribly un-semantic tables
> for simple blocks that don't need any tabular behavior except for the
> ability to calculate their width based on their content.

div {
	display: table;

does what you want, but isn't very well supported by user-agents.  A better 
workaround than using tables in many cases is using something like 
<div><span>...</span></div>, and styling the span.

I do think that there should be a more intuitive way of doing this though, I'm 
unaware of the state of this in the css 3 drafts.

Jim Dabell
Received on Friday, 14 March 2003 17:36:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:06 UTC