I’m starting to get more and more friends asking me semantic XHTML questions – wanting to do styling with CSS and good things like that. This is a great shift and I’m happy to help – however these folks are still generally asking the wrong questions when they come to me.
Semantic XHTML isn’t about replacing
divs, semantic XHTML is about using the HTML tag that best represents the data it is wrapping. If the text is a page or section title, use a heading tag (
h2, etc.) and apply your styling as needed. If you need to have a list of items for a menu or tab group, use an list.
There are lots of great tutorials about using HTML tags properly online – this one for example.
If you thinking about using semantic XHTML for a new project – congratulations, you’re on the right track. However, like any new technique, you’re going to be able to use it more effectively the better you understand it. Take some time and do some reading – pretty soon writing nice clean semantic XHTML will feel so natural it will be hard to consider doing anything else.