Validify, Semantify, Accessify
Tom is Ai’s front-end tech lead.
The following is a developmental check-list I religiously adhere to and find extremely essential in ensuring semantic-rich, accessible and valid (x)HTML.

Da Basics
- Specify a
DOCTYPEandnamespace - Specify the document’s language
- Write your markup before writing any CSS to ensure your HTML is semantic and well-formed
- Document your HTML with start and end comments for clear separation of layout blocks within your markup
-
Make sure the page validates (x)HTML
- 1.0 Strict for all new development
- Transitional for legacy applications using HTML flavors from the past
- Make sure the page
titleis set - Include all necessary
metatags - Use block and inline elements appropriately
- X-browser/X-Platform the page
- Separate blocks of content with a
div - KEEP ALL ATTRIBUTES AND THEIR VALUES LOWERCASE…KICKIN’ IT OLD SKOOL IS COOL, BUT NOT THIS WAY
Presentation and Content — Keep ‘em Separate
-
Make sure your markup is semantic in that proper elements are used in which their purpose was intended
- Layout =>
div - Headings =>
h1throughh6 - Paragraphs =>
p - List of items =>
ul,ol - Content emphasis =>
em,strong - Tabular/grid data =>
table
- Layout =>
- The presentation of content should be consistently applied regardless of CSS
Name Your Children With Some Structure
-
Name your ID’s and classes based upon the structure of its content, not presentation
content_headcontent_mainsidebarnavigation_mainnavigation_secondarylogoheaderfooter
- This will prevent renaming if the content’s look and feel changes
Headings Schmedings
- One
h1per page - Maintain the hierarchy,
h1->h2->h3…h6regardless of how cosmetically they may appear in design
Pretty Pictures
- Every image must contain a non-empty alt tag
- Dimensions on every image
- Keep images used for photographical purposes inline, not as background images
I Call ‘em Links, Anchors are for Boats
- Include title attributes on important links and/or graphical links containing no text in the image itself that describes the destination of the link
- Make sure there is always text present within the anchor even if it is a graphic
- The text should be informative, ie – use ‘close’ rather than just ‘x’ for a close button
Fontography
- Try to avoid all caps within markup and allow CSS or emphasizing elements to properly transform text so you have the option of reverting if needed
- Don’t abuse the
brtag, using multiple consecutively isn’t necessary, just begin a new block level element
Set the Table, Anthony, and Don’t Forget the…
captionelement to let users know what your table is about (look at it as short headline)- summary attribute to further describe your table’s contents in more detail
colgroup‘s for multi-column tablesth‘s for column headingstheadfor table heading content,tfootfor table’s footer content andtbodyfor the main body of the table’s grid contenttfootcomes before thetbodyin the markup…don’t ask me why- And for pete’s sake, don’t use tables for layout, that’s so 1999
Forms (Don’t Have Anything Cute for this One, Sorry)
- Don’t forget the action and method attributes (leave em blank if you don’t know, leave that mush to the back-end dude)
- Have a
legendto set the title of the form - Use
fieldset‘s to group related fields - Use
div‘s for further content separation withinfieldset‘s tabindexon each input for easy keyboard accessibility- The corresponding text for each input should be a
labelwith the for attribute set to theinput‘s ID maxcharset on inputs where necessary to assist with validation
Technology
Wow! What a great guide… This definitely gets a bookmark. I totally agree with “Dimensions on every image”. When I see pages dancing around while they are loading I know that this was left out. Here are some CSS specific tips as well. http://net.tutsplus.com/tutorials/html-css-techniques/5-tips-to-writing-better-css/
The term web standards means different things to different people. To some it means “a site without tables,” for others “a site with valid code. However, with web standards means much more. A web site developed by following the standards proposed by W3C, adheres to standards (HTML, XHTML, XML, CSS, XSLT, DOM, MathML, SVG etc) and observe good practice (Best Practices) provided by each standard (based on code valid, accessible code, semantically correct code, the URLs are simple, web hosting etc.).
In other words, a site developed respecting web standards ideally will be light, clean, CSS-based, accessible, usable and manageable by search engines.