W3C home > Mailing lists > Public > www-style@w3.org > August 2002

Re: Specific method of captioning images/objects is needed

From: shawn allen <shawn@alterior.net>
Date: Sun, 11 Aug 2002 13:28:14 -0700
To: www-style@w3.org
Message-ID: <20020811132814.B564@gryphon>

quoth Peter Sheerin:
> I've long been frustrated in my attempts to create on-line magazing
> content that contains a fair number of images with captions in a way
> that is both pleasing to the eye and validates against the most recent
> HTML and CSS specifications. I've never found a satisfactory solution,
> and have come to the conclusion that we need something like a new
> attribute or subtag for <object> to house a caption, along with a
> better method than floating to position images with captions.
>
> I'd like to see something like <caption></caption> allowed to be
> nested inside a (possibly nested) <caption> element, and have it
> rendered if any of the nested <object>s are actually displayed. Then
> it could be formatted and positioned just like a table <caption> can.

This ties into a question I was going to pose about elements enclosed
within <object>. Since there's no DTD for XHTML2 yet, I haven't been
able to figure out if something like this will be valid:

<object data="foo.gif">
    <caption>An image of foo.</caption>
</object>

Or is <object> just a PCDATA container, the pernicious mixed content of
which, minus <param>'s, is assumed to be the "alt" text?

> But there still exists the problem of positioning the image and its
> caption. Since web pages can reflow according to the size of the
> browser window, some provision needs to be made for placing the pair
> near the reference in the text. Currently this must be done by placing
> <img> and <span> tags inside a paragraph, next to the reference. But
> this limits formatting options and puts extraneous text in the middle
> of the flow (making text copied to the clipboard a jumble of content
> and caption).

Seems to me that by enclosing the caption within the object, you'd be
able to at least apply a width to the object, then an accompanying
margin for either element to position the caption (this is assuming
<object> is now a block-level element by default). This would require
some additional work on the UA's part to compute the height of the
object, though. Regardless, this might be a more "elegant" solution
than: 

> a variation on float: or position:relative that could be made relative
> to an ID. This could be a named paragraph or a named <span>. Such a
> structure would also be useful for side notes and footnotes.

Side notes and footnotes are a whole different animal...  I've yet to
find a decent way to mark those up other than:

<p>Foo bar baz<sup><a href="#footnote1">1</a></sup>.</p>
...
<p class="footnote" id="footnote1">Baz quux quuux.</p>

It would be nice to be able to inline those within the referencing
paragraph, but that would require some transformation on the UA's part
so that it makes sense (and when the footnote itself is moved in the
document structure, where does it go?). It's probably beyond the scope
of HTML for now -- but that's why we've got  XML and XSLT. :)

-- 
shawn allen
  e: shawn@alterior.net
  p: 415 577 3961
  im: shawnpallen
Received on Sunday, 11 August 2002 16:29:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:15 GMT