Best Practices
- Do not use the size attribute on your input fields. The size attribute is relative to the font size of the text inside the input. Instead, use CSS width.
- All tags, attributes, and attribute values must be lowercase.
- All attribute values must be inside double quotation marks.
- All tags must be closed. Tags that do not contain data such as image and line break tags do not need to have a closing tag.
- All IDs and Classes are lower camel case.
- A tag's ID should be the first attribute followed by a class if one exists.
- Always use the alt attribute with images. It is important when the image cannot be viewed.
- Try to avoid code lines longer than 80 characters.
Aria & Landmarks
- Use WAI-ARIA form attributes to help screen reader users to use forms - eg aria-required="true".
- Use WAI-ARIA landmark roles to help screen reader users understand and navigate a page i.e
- role="banner"
- role="complementary"
- role="contentinfo"
- role="form"
- role="main"
- role="navigation"
- role="search"