A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on IRC (such as one of these permanent autoconfirmed members).

Image Caption Examples

From WHATWG Wiki
Jump to: navigation, search

This page is a collection of sample usage for images with captions from around the web. Markup samples provided here have been reformatted and often simplified by removing presentational elements to better illustrate what "defines" the figure in them.

These real-world examples provides support for the Image Caption proposal.

Some images in the CSS 2.1 specification (example 1, example 2) use class names to add captions to figures. Reduced to a simpler form, the markup looks like this:

<div class="figure">
  <p><img src="..." alt="[caption text]">
  <p class="caption">[Caption Text]

(Note: Removed form this simplified markup is the [D] link to a long description that was put beside the image.)

Articles form the Salon.com magazine (example) use this markup for accompaniment photographs:

<div class='article_photo_right'>
<img src='...'><br />
<p class='article_photo_credit'>Photo: [Photograph's Name]</p>
<p class='article_photo_caption'>[Caption Text]</p>

MacWorld magazine website uses two-row tables to add a caption to screenshots in this article. Interestingly, they're not using the <caption> element with is meant to be used inside <table>. By using it, they could have saved themselves the trouble of specifying a width for each of their screenshots without having the image description extending the table. Here is a simplified version of the markup used on this page:

<table width="310" align="right">
   <img src="...">
   <p>[Caption Text or Image Description]</p>

Wikipedia thumbnail image with caption can be reduced to this once the links are removed:

<div class="thumb tright">
  <img src="..." alt="[Caption Text]" longdesc="..." />
  <div class="thumbcaption">
    [Caption Text]

Some documents (example) simply put the caption text inside the image.

Other Examples


  <a name="..." title="[Caption Text]"></a>
  <p>[Caption Text]</p>
  <img src="..." alt="[Caption Text]">


<div class="figureFM">
  <a name="..." id="..."></a>
  <img src="..."/>
  <h5>[Caption Text]</h5>


<table WIDTH="346">
  <img align=top src="..." ALT="Photo of Position 1">
  Position 1

Mailing List References