Build Easy

Friday, October 06, 2006

title iconA Checklist of XHTML for Semanticality

External: http://brainstormsandraves.com/articles/semantics/structure/brainstorms_and_raves_semantics_html_structure.pdf

Elements (that you should have a good grip of and use frequently):

  1. Headings: h1, h2, h3, h4, h5, h6 elements
    Use these real heading elements for the hierarchical headers of your web page, don't fake 'em with CSS!
  2. Paragraphs: p element
    A paragraph is a paragraph. Round your paragraphs with real p elements. NO br elements to fake it!
  3. Line Breaks: br element
    Minimize the use of forced line breaks, i.e. br, by resorting to p, (ul/ol, li), and CSS widths/margins/paddings.
  4. Emphasis: em, strong elements
    em and strong elements are for emphasis of texts, use cite for citations rather than them.
  5. Citation: cite element
    Mark up the name of a citation or reference with this element, inlinely.
  6. Citation: blockquote element
    Use this for block citations of text. DON'T use blockquote for just indentation, use CSS margins and paddings instead. Moreover, do provide cite="..." and title="..." properties for it.
  7. Lists: ul/ol, li elements
    When you have a list of something, use the list tags: ul and li for unordered list, while ol and li for ordered one. Lists make up an essential part of every successful HTML page.
  8. Definition List: dl, dt, dd elements
    Use definition list for terms and their corresponding descriptions. Other possible uses include marking up dialogues and illustration of links.
  9. Computer codes: code element
    Mark up computer codes like C++, XML, CSS and so forth with this element.
  10. Computer variables: var element
    Mark up programming variables with this element.
  11. Keyboard text: kbd element
    For keyboarded text, or user provided information to a terminal.
  12. Abbreviations: abbr element
    For abbreviations.
  13. Acronyms: acronym element
    For acronyms.
  14. Addresses: address element
    Mark up addresses or authorships with this element.
  15. Table captions: caption element
    The content of a caption element appears atop the table as title.
  16. Modifications: del element and ins element
    Texts marked up with del tags are rendered as deleted with a strike-throughs. If you are modifying a small part of your document, you may want to mark up the deleted part with a del tag and the replacing part with a ins tag, so that both people and computer know exactly how and where you have modified the page.
  17. Form semantic facilities: label element, fieldset element and legend element Don't forget to label the texts with label elements for users to distinguish form controls like text input, radios, and checkboxes.
    You can divide a form up into several logic components by employing fieldset elements, with legend element containing the title for each of them.
  18. Other table semantic facilities: thead element, tbody element, tfoot element
    Put thead, tbody and tfoot tags respectively around the header part, body part, and footer part of the table for semanticality.

Attributes (that you should have a good grip of and use frequently):

  1. Make meaningful id and class names.
  2. Alternative text for images: <img ... alt="..." />
    Always provide an alt attribute to images, i.e. img elements.
  3. Titles: <a ... title="...">...</a>
    Title property helps users distinguish your content more easily and furtherly. Almost all presentational elements accept it, so use it as much as possible, especially for links, i.e. a elements.
  4. Table summaries: <table ... summary="...">...</table>
    Always provide a summary for real tables.
  5. Language specification: <html lang="..." xml:lang="..."></html>
    Almost all XHTML elements accept language specifications. Always provide your html element and other elements wherein texts are in languages other than that specified in the html element with them.

A more formal list of semantic XHTML elements and attributes as well as a collection of more in-depth articles is available at microformats.org/wiki.

»Post a Comment

0 Comments:

»Post a Comment

Links to this post:

Create a Link

« Home