Semantic HTML is one of those ideals that I aspire to achieve. I see its value, but I am often faced with the worry that I am adding unnecessary markup in the form of DIVs and SPANs. Smashing Magazine has just published two excellent articles that cover the value of semantic HTML from two differing points of view.
Divya Manian argues in her article ‘Our Pointless Pursuit Of Semantic Value‘ that:
Mark-up structures content, but your choice of tags matters a lot less than we’ve been taught for a while.
On the surface this statement is correct. To many people ‘meaning’ in a document is conveyed by how it looks, and this is not just for those published as web pages. Think of a Word document. How many people use ‘Styles’ to define a heading and not just choose a larger font size and ‘bolding’ the text? Both methods achieve the same goal – a line of text that stands out from the rest.
You have to dig below the surface though. Still using the Word document example, you have to consider beyond just the visual. Making use of the ‘Styles’ to denote a heading truly sections the document and provides hooks to generate a table of contents and other functions. Benefits are provided from using Word and it’s markup correctly.
More importantly, we also have to consider the fact that many users suffer from varying degrees of visual impairment. These users rely on various aides to help them ‘read’ the web page. Many of these ‘aides’ rely on the tags that are used within the document to provide the intent of the text in the same way that spacing, font type, font size etc provide visually. Ask yourself this – are you callous enough to disregard these people, when you may be one of those people in the future?
Jeremy Keith responds to Ms Manian in his article ‘Pursuing Semantic Value‘ and does point out what Divya Manian was really trying to get at:
Not semantics are useless but its not worth worrying over minute detail on.
I agree with this statement to a degree. The example Divya presents at the start of her article of somebody worrying about the amount of DIV and SPAN tags that they have used within their page is exactly the same I was confronted with. My take on all this is as follows.
Make sure the semantic meaning of the document is correct but don’t get hung up on the amount of layout tags that you are using.
PostScript, LaTeX, Word etc all have layout control characters or tags. They are needed and are used as often as required, whether that is a couple or a couple of hundred. Just remember that text surrounded by STRONG or EM has a meaning beyond the visual that is not conveyed by a styled DIV or SPAN.
If my argument has yet to sway you, let me make a cheap shot at your ego – in the Word example, the user who doesn’t use ‘Styles’ is the novice who is just muddling their way through. The user that uses the ‘Styles’ is the proficient user who knows what they are doing. Which are you?
