semantic markup
The markup is a notation of the content - the code - consisting of elements denoted by tags, which are interpreted by the browser to make the view.
Markup is semantic when tags are chosen according to what they mean. Valid, semantic markup makes your site's content attractive to Google, or any other search. Findability is the term for the benefit of search engine optimization (SEO).
- only one <h1> on the page
- <a href="/about/" title="learn about clean code for a better web">Learn more</a>
- <img src="/proper.png" alt="beautiful icon" />
- open and close every tag <p></p> special syntax for 3 exceptions: <img />, <br /> and <hr /> with a space before the slash
- use a semicolon on every CSS selector's property/value pair: .bam { color:#ccc; margin:7px 0; }
- use <strong> and <em> not <b>, <i>
descendant selectors
ID naming conventions is at the foundation of standards based design.
structural naming identifies the
semantic role of that bit of the document.
focus on the functional naming rather than the colorful naming:
#branding instead of #top_left_flower_header (what if it changes to a tree and aligned right...)
#nav instead of #gray_primary_links (what if they change to purple...)
#header
#branding
#logo
#tagline
#nav
#content
#panel
#aside
#footer