Semantics is the boss

Many developers that start to embrace the web standards find it difficult because of one little simple thing: semantics. Semantics is the soul of the business. Semantics is the key of web standards development, If you know semantics you’re already half way there.

By now, every developer should know that every TAG has a semantic function associated with it. If you want a title or header inside your document (not the title TAG, that is the title of the whole html page) the tags to use are H1, H2, H3, and so on… If you want a text paragraph, then you have the P tag. Plain simple.

The DIV tag is used to divide the layout into sections. The layout is usually divided into sections like: header, footer, menu, left column, right column, main content, and so on… To separate these sections the semantically correct tag to use is the DIV tag. No TABLE tag, no SPAN tag, no P or other tags should be used to do this task. DIV was created to do this job. Using any other tag is wrong.

Not to mention that using the correct tag, the semantically correct tag, will help you a lot when implementing CSS. You will end up with a lot more variety of tags. You will be able to identify all the parts of your layout a lot more easily. Imagine if your maing your layout with Lists (UL, OL and LI tags): you would have to create classes in all objects in order to identify them and create the CSS rules for them. That is swimming against the tide.

Even if you use a simple P or B or LI tag to create your layout, you cannot use CSS to change the tag semantics. If you do it you’re doing it all wrong.

So, dont forget: semantics matter!

I would be very happy to hear from you. Please comment and… have fun! As allways :)

RSS feed for comments on this post · TrackBack URL

Leave a Comment