In a time where we have so many templates and frameworks to choose from in designing and developing web sites, does it even matter any more to know how to write good HTML?
It sure does! In fact, now more than ever.
Take mobile, which is all that anyone ever talks about. Sloppy, bloated code will slow the download speed of your pages. On cellular networks that could be a site wrecker.
But I’m here not to tell you why, but to tell you how to write HTML that is smart, clean, and brings goodness to web pages. (You’ll just have to trust me on the "why" thing for now.)
Here’s some pretty low hanging fruit to get your HTML coding skills in much better shape.
Why would you?
<p></p> is strictly verboten. If you are thinking that it will get you some white space, forget it. That’s what CSS does.
With HTML, less is always better than more. Useless junk like
<p></p> is just that — junk!
This one is my personal bug-a-boo.
For years web page creators begged to have meaningful HTML tags like:
to get away from junk like:
So, when I still see people using that old crappy markup, I just want to cry.
If you are still doing things like:
<img src="logo.gif" alt="Apple" width="100" height="100" />
you can go ahead and lose the width and height attributes right now.
That’s just more code bloat. Use CSS.
Good web content comes in the form of a hierarchy where the information is grouped so that the most important content is presented at the top of the page or section. Using Heading tags is a lot like setting up headlines and sub-heads for a page.
For more on this, see my How To Use Heading Tags In A Web Page where I talk about the two different ways of using these tags.