There’s a simple, easy way to write better HTML code. Just remember to use HTML to structure your content and CSS to present it. Don’t use HTML display tags, but instead create a separate CSS stylesheet to format your webpage.
Writing this way is easier because CSS gives you all the design and display features you will ever need. CSS is specially written for webpage design; HTML is not. Infact HTML was originally written for documents with hyperlinks.
Dividing structure and presentation in this way makes HTML easier to write with less code. It downloads faster for your visitors and it’s more search engine friendly too. It can reduce the amount of code by up to 4 times!
Most professional web designers recognise that using HTML to control the look of you webpage is obsolete. And most designers use CSS for positioning and placement on the page instead of tables, which used to be popular.
So, for good HTML, do use header, paragraph, list, image, divider and span tags. But don’t use font, bold, italics or any other display tags. And only use the table tag to create, well, tables. For example, a school timetable.
To use a separate style sheet you simply add the following code after your ‘doctype’ lines,
<link rel=”stylesheet” type=”text/CSS” href=”style.css”>
Where style.css is your separate stylesheet file containing CSS tags.
When you have coded your page, validate it using the markup validation service, because you can’t create valid CSS with invalid HTML.
For definitive HTML, XHTML and CSS tutorials visit w3schools and for a simple list of HTML tags take a look at the w3schools tags. W3 schools claim to be the largest web developers site on the net. It’s certainly a good reference.
To make your HTML coding easy does mean you need to learn CSS, but the benefits are many, not least of which is easy maintenance of your website.