W3C home > Mailing lists > Public > www-validator-css@w3.org > February 2009

Re: Floats need explicit width??

From: olivier Thereaux <ot@w3.org>
Date: Fri, 13 Feb 2009 16:36:38 -0500
Cc: www-validator-css@w3.org
Message-Id: <0D295DFA-14CD-4504-A12E-809E4CF2FD95@w3.org>
To: Paul McKeown (Tiscali) <ppjmckeown@tiscali.co.uk>

Hi Paul,

On 12-Feb-09, at 7:39 PM, Paul McKeown (Tiscali) wrote:
> However, the following CSS 2.1 code fragment, has started generating  
> a warning, which it never seemed to generate before
> The warning is:
> In (x)HTML+CSS, floated elements need to have a width declared. Only  
> elements with an intrinsic width (html, img, input, textarea,  
> select, or object) are not affected

Indeed. It looks like this is a case of fixing an old bug without  
first checking that it is still relevant. My bad.
A few weeks ago I started working on long-standing enhancement request:

I followed the bug report blindly because:
* that was what CSS2 said
* I had a lot of experience fighting with IE and floats, and hav it  
hardwired in me that a float without a width is asking for trouble.

In retrospect I should probably have made this an error rather than a  
warning, since it breaks a "must" in the specification.

Turns out, as you noticed, that CSS2 is saying "MUST have a width" and  
CSS21 says "whatever, forget what we said about the width". That makes  
the warning moot (at least in terms of compliance for CSS21 and more  
recent). One thing I wonder, however, is whether floated elements  
without a width still cause significant trouble. I asked around to a  
few friendly web designers and integrator and the consensus seems to  
be "for IE, setting a width is always safer".

So... should we make this a warning, but lower level (and thus not  
shown by default, which I'm sure will make everyone allergic to  
warnings happy ;) )?

Received on Friday, 13 February 2009 21:38:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:01:04 UTC