What Beautiful HTML Code Looks Like

This is some extracts of Chris Coyier’s article on css-tricks.com

DOCTYPE Properly Declared
It looks like a lot of gibberish, but DOCTYPES are important. They not only allow your code to validate, but they tell browsers things about how to render your page. Simple tags don’t cut it

Main DIV for all Page Content
Putting all the content of your page into one main “wrap” DIV gives you lots of control right off the bat. There is where you can set the width of your page for a fixed width site or maximums and minimums for a fluid width site.

Proper Ending Tags
You started strong, now end strong. Don’t be lazy and exclude closing tags for any element, even if the page renders OK without them.

No Styling!
Your HTML should be focused on structure and content, not styling! Keep all of your styling in your CSS, there should be no deprecated tags (e.g ) in site.
clean code

Leave a Reply