10. HTML is used to format content


HTML format incorrect example

Description: Presentational attributes such as ‘border’, ‘align’, or ‘bgcolor’ are used. CSS should be used for styling instead.

Context: To prevent extraneous text from being read by screen readers, it is best practice to keep the HTML as uncluttered as possible, including removing in-line styling. However, in some cases removing in-line tags can be impractical, as they are generated by plugins or vendors that you have no control over. This should be evaluated on a case-by-case basis.

<img src="images/spacer.gif" alt="University of Hawaii at Manoa" width="200" height="100" border="0">

How to fix it: It’s important to review these issues and determine if they can be fixed by moving the presentational attributes to your CSS. It’s not always practical to make these changes, but should be made when possible.

<img src="images/spacer.gif" alt="University of Hawaii at Manoa" id="spacer">
    width="200" height="100" border="0"