W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2009

[whatwg] <figure><img><* caption>

From: Kit Grose <kit@iqmultimedia.com.au>
Date: Tue, 1 Dec 2009 11:07:34 +1100
Message-ID: <0F86A4D3-741D-46B8-85EE-5E9FD2214315@iqmultimedia.com.au>
On 01/12/2009, at 6:28 AM, Tab Atkins Jr. wrote:

> People will very commonly use a wrapper in any case, for styling the
> figure+caption together.  For example, putting a border and background
> on it and positioning it.


I agree with the inclusion of a wrapper in that in the standard use-case the entire figure is likely to be floated in a document; I can't think of any situation where captions would be in a different container than the element it refers to.

Is there a semantic reason for <p caption> rather than simply repurposing the <caption> element itself? It seems to me that captions in this context are conceptually identical to captions for tables?

I would imagine all of these to be legal (with both figure and caption being explicitly block-level elements):

<figure>
	<img />
	<caption>Foo</caption>
</figure>

<figure>
	<caption>Foo</caption>
	<img />
</figure>

<figure>
	<div>
		<img />
	</div>
	<caption>Foo</caption>
</figure>

<figure>
	<div>
		<img />
	</div>
	<div>
		<caption>Foo</caption>
	</div>
</figure>


Cheers,


Kit Grose
User Experience + Tech Director,
iQmultimedia

(02) 4260 7946
kit at iqmultimedia.com.au
iqmultimedia.com.au
Received on Monday, 30 November 2009 16:07:34 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:19 UTC