The Image feature provides the user with the ability to insert a self-contained image, that can be referenced from edited content.
The image is usually accompanied with a caption.
The <figure>
element MUST be used to represent the Image feature as it is the standard way to express self-contained non-textual additional content[1].
The <figure>
element SHOULD have a class
attribute which value is set to image
to identify that the element is being used for representing image and to allow styling that particular use-case.
The <img>
element MUST be used to represent the image itself as it is the standard way to express an image in HTML[2].
The <img>
element MUST have at least the following attributes:
src
attribute with a valid URL pointing to the image[3].alt
attribute that contains the textual alternative for the image, if any, or is empty, if the image conveys the information that could be derived from its context or caption[4].The caption, if it is present, MUST be represented by the <figcaption>
element[5].
Example:
<figure class="image">
<img src="http://c.cksource.com/a/1/img/sample.jpg" alt="Saturn V carrying Apollo 11">
<figcaption>Figure 1: Beginning of Apollo 11 mission</figcaption>
</figure>
<figure>
element definition in the HTML5 standard.<img>
element definition in the HTML5 standard.<figcaption>
element definition in the HTML5 standard.