Skip to main content

Posts

Showing posts from January 13, 2013

How to write better semantic HTML

Semantic HTML, is HTML where the tags used to structure content are selected and applied appropriately to the meaning of the content. Use this handy guide as a reference when writing HTML or xHTML. 1. Limit the use of ID's for layout sections and use them more for JavaScript hooks 2. Use Sprites whenever possible 3. Use tag for repeated data that has a naturally tabular form. Never use for layout purposes.<table></table>4. only use to denote a paragraph of text. Never use for spacing alone. 5. <pre><input /></pre>, prefer to use <button> for buttons</button> 6. aim to have one on each page, description of the page</div>&nbsp; &nbsp; <h2> define section of the page</h2> <h3> sub-section of the page and follow an </h3> <h2> logically.</h2> 7. <center> Never use it. Use block-level tag with text-align: center/margin: 0 auto</center> 8. Use <button> tag .