Category: 3. Tips and Tricks
-
Use HTML comments wisely
To make your HTML code clearer for you (and for others), you can add comments to your code. These are snippets of code that are ignored by Web browsers, so they’re useful for adding short notes and reminders within the code: Learn how to write and use comments in our HTML Comments tutorial.
-
Use an HTML validator
It’s a great idea to run your Web pages through an HTML validator before you publish them on your Web site. These programs will pick up potential problems such as missing closing tags on tables, and using tags that won’t work properly on all browsers. Don’t forget – just because your page looks great in…
-
Style HTML using style sheets wherever possible
Style sheets will make your HTML coding life so much easier. No more <font> tags everywhere! You also get much finer control over the way your pages look, and you can change their appearance just by editing one style sheet file. If you haven’t worked with style sheets yet, pop over to our CSS tutorials to get going!
-
Always close your HTML tags
When you type an opening HTML tag (e.g. <b>, <p>), always place the corresponding closing tag at the end. For example: This will ensure that your HTML pages work properly on all browsers, and will help to prevent any strange problems occurring in your pages! This is especially important with tags such as <div>, <span>, <table>, <tr> and <td>. Some tags don’t have a corresponding closing tag…