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

Positioned floated inline

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 14 Jul 2004 22:42:35 -0500
Message-ID: <40F5FD2B.7040506@mit.edu>
To: www-style@w3.org

I have an interesting question regarding the interaction of "position", "float", 
and "display"...  Consider the following CSS and HTML:

<html>
  <head>
   <style type="test/css">
     #test {
       position: absolute;
       float: left;
       display: inline;
     }
   </style>
  </head>
  <body>
    <p>First line <span id="test">Still first line?  Where?</span></p>
  </body>
</html>

Now per CSS2.1 section 9.7 [1] the computed value of float is 'none' and display 
is set to 'block' (see the table in said section).

All well and good.  But now we go to lay out the content.  Since we have an 
absolutely positioned box all of whose offsets are auto and whose width is auto, 
we have to find the static position (per section 10.3.7 [2]).  Now if the 
position had been 'static', then float would not compute to 'none', and the 
display would still compute to block.  So the static position would be at the 
far left end of the first line of the paragraph.

Is this in fact what the specification requires?  That the static position be 
the position the float would have floated to were it not positioned?  That 
computation gets a bit more complicated if there are other floats present, of 
course...

-Boris

[1] http://www.w3.org/TR/CSS21/visuren.html#dis-pos-flo
[2] http://www.w3.org/TR/CSS21/visudet.html#static-position
[3] Reference: http://bugzilla.mozilla.org/show_bug.cgi?id=237770
Received on Wednesday, 14 July 2004 23:42:49 GMT

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