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

Floats need explicit width??

From: Paul McKeown (Tiscali) <ppjmckeown@tiscali.co.uk>
Date: Fri, 13 Feb 2009 00:39:43 +0000
Message-ID: <BAY116-DAV9C04918B0B1574B37311B91B80@phx.gbl>
Message-ID: <4994C14F.6060100@tiscali.co.uk>
To: www-validator-css@w3.org
Dear W3C,

I have used your validators for a long time and have always thought them 
excellent tools.

However, the following CSS 2.1 code fragment, has started generating a 
warning, which it never seemed to generate before (unless I have been 
particularly inobservant).  The fragment is:

    #navbar li {
        /* position the navigation tabs by floating them left */
        float: left;
        /* space out the tabs by applying a right margin */
        margin-right: 0.3em;
        /* remove the bullet */
        list-style: none;
        font-size: 90%;
        font-weight: normal;
    }

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

However, I thought that that is not true.  To quote the W3C 
(http://www.w3.org/TR/CSS21/changes.html#q57):


      C.2.50  Section 9.5 Floats
      <http://www.w3.org/TR/CSS21/visuren.html#floats>

Floats are no longer required to have an explicit width.


Am I losing my mind or is the css validator suddenly bonkers?  Please help!

Best Regards,
Paul McKeown.
Received on Friday, 13 February 2009 08:29:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 June 2012 00:14:22 GMT