HTML peeve: image captions

March 9, 2003 10:32 AM

It's absolutely insane that there's no way in HTML to associate a caption with an image. Title attributes don't count, you only see them on mouse-over, so they end up being a ‘mystery meat caption’. The closest you can get right now is putting the image in a table, and then using the table's <caption> element to caption it. Semantically, that's Just Wrong.

The <object> tag doesn't help in this regard either.

And, of course, this is never going to get fixed for the mainstream web, because HTML4 is no longer being updated, XHMTL1 is just a transition, and the w3c is going off into their weird fantasy-land for XHTML2.

4 Comments

You can get the title attribute to display after the image with a little CSS:

img:after{content:attr(title);}

Needs a CSS2 browser to work though.

i couldn't get the CSS code you posted above to work. I'm using the latest version of IE. Instead, the 'title' is the rollover text instead of the 'alt' text.

-june

IE 6 is not a CSS2 compliant browser.

Are there any CSS2 compliant browsers?

Comments are no longer being accepted for this blog entry. If you really want to make your voice heard, you can always email me.

Previously: Mes Souvenirs...

Next: Wanted: multiple exception-type catch blocks