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

RE: [CSS 2.1: 9.8.3] 'clear' applies to inline elements?

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Wed, 25 Mar 2009 11:33:29 -0700
To: MURAKAMI Shinyu <murakami@antenna.co.jp>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <7C2F64B551D8664AAD94A28DAC37D0206B64FFED91@NA-EXMSG-C103.redmond.corp.microsoft.com>
Not sure if this was answered yet.

I can't tell for sure how 'clear' got the broad language that allows applying it to anything. The only case of inline element that actually requires that is <BR> (at least the only one I am aware of).

<BR> however is a weird element, which cannot be fully defined in terms of CSS2.1. It is defined as "inline" but in reality it is neither inline nor block. For compatibility reasons, it needs to support 'clear' and 'page-break-*' properties.

Also, 'clear' may be applicable to absolute positioned elements, which are of course blocks but their "hypothetical static positin" may or may not account for clear (there is no clarity for whether it should, and there is no interop).

For CSS2.1 language to precisely define behavior of 'clear' on non-blocks it needs to special-case <BR> as an element (which CSS generally tries to avoid), and I am not even sure what it has to say about positioned. At this point of spec state either would be too big of a change for 2.1.

-----Original Message-----
From: www-style-request@w3.org [mailto:www-style-request@w3.org] On Behalf Of MURAKAMI Shinyu
Sent: Friday, March 20, 2009 8:36 AM
To: www-style@w3.org
Subject: [CSS 2.1: 9.8.3] 'clear' applies to inline elements?

http://www.w3.org/TR/CSS21/visuren.html#comp-float
| 9.8.3 Floating a box
|  ...
|     <SPAN id=inner> Inner contents.</SPAN>
|     <SPAN id=sibling> Sibling contents.</SPAN>
|  ...
|  However, if the 'clear' property on the sibling element is set to
|  'right' (i.e., the generated sibling box will not accept a position
|  next to floating boxes to its right), the sibling content begins to
|  flow below the float:
|     #inner { float: right; width: 130px; color: blue }
|     #sibling { clear: right; color: red }


In this example, the 'clear' property is specified at an inline-level 
element <SPAN id=sibling>. This contradicts the definition:
| 9.5.2 Controlling flow next to floats: the 'clear' property
|  'clear'
|         Applies to:       block-level elements


I searched the mailing list and found this problem was already reported:
http://lists.w3.org/Archives/Public/www-style/2003Oct/0189.html
http://lists.w3.org/Archives/Public/www-style/2004Oct/0081.html

and found the CSS WG response:
http://lists.w3.org/Archives/Public/www-style/2004Feb/0233.html
|    The example is indeed inaccurate, but we're going to leave
|    it for now.

I think this inaccurate example confuses people learning CSS
and hope this will be corrected before the CSS2.1 final REC.

Regards,

-- 
Shinyu Murakami
http://www.antennahouse.com
Antenna House Formatter
http://www.antenna.co.jp/AHF/en/
Received on Wednesday, 25 March 2009 18:34:15 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:17 GMT