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

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