7. Center tag used to format content

1.3.1

Incorrect center tag example

Description: The HTML center tag has been used to center content. HTML should not be used for presentational purposes, but only for semantics to allow for different presentations of the content.

Context: Styling-specific tags are discouraged for ADA-compliance, adjustments to appearance strictly for aesthetics should be restricted to CSS.

<center>
   <table width="148" border="0" cellspacing="0" cellpadding="0">
     <tbody>
       <!--Content-->
     </tbody>
   </table>
</center>

How to fix it: Use semantic elements to indicate emphasis or structure, and CSS to handle styling.

<table width="148" border="0" cellspacing="0" cellpadding="0" class="center">
   <tbody>
     <!--Content-->
   </tbody>
</table>
.center {
   text-align: center;
}

Techniques: G115G140H49