W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: [CSS21] Does 'clear' apply to caption box? (corrected link)

From: Anton Prowse <prowse@moonhenge.net>
Date: Tue, 08 Jan 2013 22:08:10 +0100
Message-ID: <50EC8ABA.6010407@moonhenge.net>
To: www-style@w3.org
CC: a1949aea6a5130b8f19696e2cdb95407.squirrel@ed-sh-cp3.entirelydigital.com, Daniel Schattenkirchner <schattenkirchner.daniel@gmx.de>, Gérard Talbot <www-style@gtalbot.org>
On 08/01/2013 16:48, Daniel Schattenkirchner wrote:
> On 07/01/2013 21:16, "Gérard Talbot" wrote:
>> Le Lun 7 janvier 2013 10:18, Anton Prowse a écrit
>>> Le Ven 14 décembre 2012 21:29, "Gérard Talbot" a écrit :

>>>> I believe this test
>>>> http://test.csswg.org/suites/css2.1/20110323/html4/clear-applies-to-015.htm
>>>> may be incorrect.

>> which would mean that clear can/could apply to an element with its
>> display property set to 'table-caption'. So, at least the meta text
>> assert isn't completely true.
> I'd agree, since table-captions are block-level boxes (to which clear
> applies).

>>> Note that if you had two captions in a CSS-styled table (something
>>> which is invalid in HTML4 tables), you could float both of them
>>> left and set "clear:left" on the second one, to observe that
>>> 'clear' does apply to table captions... although it isn't a very
>>> useful design pattern so I don't imagine authors do it much!
> A floated table-caption is a display: block; box and not part of
> anonymous table box generation.

Whoops, you're right of course!

> It's impossible to create a testcase to test whether clear really
> does apply to table-captions.

No, the following should work instead:

<div style="display:table; width:100%">
     <div style="display:table-caption">
         <div style="width:20px; height:20px; float:left;"></div>
     <div style="display:table-caption; clear:left;">caption</div>

> And even though CSS does allow
> consecutive caption boxes, they are not supported by Gecko and WebKit.

Yeah, this seems to be a new thing in Gecko, since I'm sure I've messed 
around with multiple captions in the past.  Note that CSS21 Ch.17 is 
internally inconsistent on the subject of multiple captions, but very 
strongly points towards allowing multiple captions.  Also, in Gecko at 
least, captions invalidly establish a block formatting context.  So 
there are browser bugs here.

Anton Prowse
Received on Tuesday, 8 January 2013 21:08:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:25 UTC