Figures - Do you use the right HTML/CSS code to add images and captions?
30/11/2017 6:29 AM by
Most developers put the image and the caption in a DIV tag. The figure is just a paragraph.
Figure: Bad Example
Instead, you should use <DL>, <DT> (which is the item in the list – in our case an image) and <DD>for caption. This structure gives semantic meaning to the image and figure.
Figure: Good Example Note:
<dl> stands for "definition list
"; <dt> for "definition term
"; and <dd> for "definition description
Do you feel this rule needs an update?