HTML Best Practices for all

Without further argument, let’s review best practices to examine when creating your markup.

1. Always Close Your Tags

2. Declare the Correct DocType

3. Never Use Inline Styles

4. Place all External CSS Files Within the Head Tag

5. Consider Placing Javascript Files at the Bottom

6. Keep Your Tag Names Lowercase

7. Use H1 – H6 Tags

8. Never Use Inline Javascript

9. Bind Navigation with an Unordered List

10. All Images Require “Alt” Attributes

11. Use a CSS Reset

For Instance

  1. html, body, div, span,
  2. h1, h2, h3, h4, h5, h6, p, blockquote, pre,
  3. a, abbr, acronym, address, big, cite, code,
  4. img, ins, kbd, q, s, samp,
  5. small, strike, strong,
  6. dl, dt, dd, ol, ul, li,
  7. fieldset, form, label, legend,
  8. table, caption, tbody, tfoot, thead, tr, th, td {
  9. margin: 0;
  10. padding: 0;
  11. border: 0;
  12. outline: 0;
  13. font-size: 100%;
  14. vertical-align: baselinebaseline;
  15. background: transparent;
  16. }
  17. body {
  18. line-height: 1;
  19. }
  20. ol, ul {
  21. list-style: none;
  22. }
  23. blockquote, q {
  24. quotes: none;
  25. }
  26. blockquote:before, blockquote:after,
  27. q:before, q:after {
  28. content: ”;
  29. content: none;
  30. }
  31. table {
  32. border-collapse: collapse;
  33. border-spacing: 0;
  34. }
January 18th, 2010 by