Tags to Avoid

You will find lots of tags in various web pages that are not a part of the XHTML strict standard. These tags fall into two groups.

Deprecated tags are ones that were valid tags in older HTML versions which are no longer required when coding modern XHTML as there is a better way of achieving the same effect. There are also a few tags which while still a part of the standards are ones which you will seldom if ever have a use for if you always use the most semantically correct tags to identify your content.


The following tags have been deprecated as there are now beter ways to achieve he same result.

Instead of using frames you can either use object elements or use stylesheets and JavaScript to achieve the same overall effect.


Proprietary tags never have been a part of the web standards but were introduced by specific browsers back prior to the current standards being developed in order to allow new features to be added into web pages that those past standards didn't provide for. There is no longer a need to use such proprietary tags since the current standards provide a standard way of producing the same result without the need for any proprietary tags.

Some commonly found proprietary tags include bgsound (Internet Explorer) and embed (Netscape) both of which perform functions that can now be done using the standard object tag. Another proprietary tag marquee (Internet Explorer) defines a behaviour for its content and therefore he effect should be produced using JavaScript in order to produce that behaviour properly across all browsers.

Not Semantic

There are even some tags that are still a part of the XHTML strict standard which have not been deprecated but for which there is no real use in properly coded web pages.

One example of this is the noscript tag which surrounds content that is only to be displayed if the browser does not support JavaScript. The same effect can be better achieved by giving the content a class or id and then using JavaScript to hide the content when it isn't required. This gives much greater control since not all browsers necessarily support all of the JavaScript functionality that you might need and you can therefore use feature sensing to only hide the content when the browser supports all of the code needed to run the script. The only time a noscript tag would be actually useful would be in the head of the page where it could be used to apply additional styles for pages that don't support JavaScript as the page is loaded rather than having to wait for the JavaScript to run however noscript tags are only valid in the body of the page and therefore can't be used in the only place where using them would still be useful.

The b and i tags indicate that their content should be displayed in bold and italic respectively. Most web pages use those appearances to provide some sort of emphesis o selected words in the content. There are other ways in which such emphesis can be applied, particularly with other web devices such as readers where the content is spoken rather than displayed. How do you speak something in italic? You can't. The strong and em tags are therefore the correct ones that should be used in most cases. The only place where the b and i tags are the semantically correct tags to use are in pages discussing typography where examples of bold and italic text are included in the discussion. Of course since these tags are much shorter than the semantically correct ones and will therefore save a few characters when you are typing up your content and make the page fractionally faster to download, and since all browsers basically treat b and strong as equivalent and i and em as equivalent, you may make a conscious decision to use these tags even in places where their use is not semantically correct.

Another pair of tags which do not really have any semantic meaning are big and small. These are really presentational tags that define that their content should either be bigger or smaller than the surrounding text. They do not however define how much bigger or smaller the text should be and so unless you apply styles to them you are leaving it up to the browser to decide how much the text size should vary. Since you have to style these tags to get them to work properly and can get the same effect simply using styles without needing the tags it is better to avoid using them. In any case what are they supposed to mean when the text is spoken. Asking yourself whether the tag you are using is meaningful when your web page is read out rather than displayed is in fact a good way of determining whether the tags you are using are appropriate semantic tags to define the content.

Tne final valid tag for which there is now little use is hr. The purpose of this tag is to display a horizontal rule across the page. Again it is purely presentational in nature in most cases. In addition some browsers do not even allow you to apply styles to the hr to allow you to change its appearance. You can therefore create horizontal rules far more effectively in most cases by styling the top or bottom border of an adjacent element.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow