Use valid markup and styles

Good HMTL/XHTML is the basis for good accessible design. Web browsers, whether assistive or not, are designed to implement certain Web standards. Most, if not all, attempt to "fix" errors they encounter in Web pages, and all deal with deviations from the established Web markup standards in different (and unpredictable) ways. By ensuring that the markup used to code a Web page adheres to a defined standard, you ensure the best compatibility with the largest number of browsers, assistive or otherwise. The World Wide Web Consortium (W3C) defines the current standards for HTML and XHTML (with XHTML now replacing HTML as the primary Web standard).

In addition to page markup, it is also important to use valid Cascading Style Sheet (CSS) definitions on your pages. CSS standards are also defined by the W3C.

Guidelines

  • Declare the Web standard (markup and the CSS standards) you're using with DOCTYPE (short for "document type declaration"). The DOCTYPE is essential to the proper rendering and functioning of Web documents in many compliant browsers, and also informs validators which version of (X)HTML you're using. DOCTYPEs are a key component of compliant Web pages: your markup and CSS won't validate without them.
  • Use a Web development tool that can help verify compliance of your code against the standards, such as DreamWeaver or GoLive
  • Refer to books for guidance in using Web standards
    • Designing With Web Standards, by Jeffrey Zeldman,ISBN: 0735712018
    • Web Standards Solutions, by Dan Cederholm, ISBN: 1590593812
    • Accessible XHTML and CSS Web Sites, by Jon Duckett, ISBN: 0-7645-8306-3
  • Use validation tools to check the compliance of your Web pages. Two tools are