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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 30 Nov 2009 13:28:50 -0600
Message-ID: <dd0fbad0911301128r5e9a4480pd0d8f884b84890d1@mail.gmail.com>
On Mon, Nov 30, 2009 at 1:06 PM, Nikita Popov <privat at ni-po.com> wrote:
> Your proposed syntax looks more nice. But still, why do we need the
> figure-wrapper? It would be cleaner syntax, in my eyes, if you could easily
> specify an element that is related as a caption to another element. Could
> look like this:
> <img src="bunny.jpg" alt="A Bunny" id="bunny">
> <p caption="bunny">The Cutest Animal</p>
> or
> <img src="bunny.jpg" alt="A Bunny" id="bunny">
> <p for="bunny">The Cutest Animal</p>

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.

As well, using a wrapping element to implicitly scope things is easier
than explicitly using indirection like @for.  I always prefer to do
<label>text <input></label> instead of <label
for=foo>text</label><input id=foo>, for example, because it's just
plain easier to maintain.

~TJ
Received on Monday, 30 November 2009 11:28:50 UTC

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