Thursday, October 27, 2011

Blog Post #8: What is Semantic Markup?

What is semantic markup? Why should web designers use it? Why is coding "meaning" into the structure of a document important? How does this make the document more accessible and search engine friendly? Why do many designers seek to separate structure from presentation? Can you write examples of how designers might accidentally ignore semantic markup and/or how it should be applied?

Semantics has to do with the meaning of things, and is a topic of considerable importance to people who are much more into literary theory and criticism than I am. Mostly it is discussed in literary criticism like Ferdinand de Saussure's famous work Course in General Linguistics.

Semantics also indicates meaning in term of HTML markup. Basically, it is markup that provides some meaning. It mostly has come about in the more recent versions of HTML (HTML 4 particularly, not sure about HTML 5, but since HTML 5 seems to favor eliminating DIV tags in favor of more specific tags like <header> and <section>, I imagine it also supports semantic markup), in which many of the popularly-used "presentational" tags (i.e., ones that didn't have any meaning besides presentation) were deprecated. This may also have to do with the rise of CSS, since CSS's raison d'être is to take care of the presentational stuff.

I confess I don't know much about semantic markup, but it seems the best reason for using semantic markup is that it is "HTML that describes the content" (as the BBC Guide linked to on the class site says). This, according to the BBC guide, helps avoid browser compatibility issues and also separates presentation from content, which is becoming a more desired idea thanks to the increasing adoption of CSS. I suppose it would also be useful to any non-tech savvy person who might have some reason to be looking at your code. Doing this also would probably help your code stay cleaner (much the way, as I'm learning in MAT 225, coding PHP to do certain things can make your code cleaner because all the PHP is stored server-side and not seen by the client on the other end).

Encoding meaning into a document would make it more user-friendly because it would take into consideration the fact that readers online often scan rather than read articles and so on. It would also make it easier for search engines to index you in a meaningful way (though doing something like submitting a site map to Google also helps).

I think designers seek to separate presentation from structure in HTML because CSS is capable of taking care of all, or pretty much all, of the presentational stuff anyway. And since an external style sheet allows you to control the whole site's style in one document, this allows you to cut away a lot of the frills from the HTML that are no longer needed.

The BBC guide suggests tags to avoid when using semantic markup. These include the deprecated bold and italic tags (<b> and <i>), which apparently don't mean anything (though I'm not sure how their replacements, <em> and <strong>, mean anything either). Some of the tags they suggest not using make sense though, like <strike> for striking through a line to indicate a change (no one really does that anymore anyway, that I know of) and the purely presentational tags <blink>  (blinking text, even when it was popular to use the <blink> tag, was generally found to be rather annoying anyway) and <marquee> (which basically let your text scroll like a New York stock ticker...it was fun for a while but I don't think anybody does that now either). CSS, Javascript, and PHP can probably take care of any of those things anyway.

Semantic markup should be applied where it is needed, especially in cases where the tag you might use for something is deprecated as a presentational tag. It's probably the best choice in any situation though, really.

I'm sorry I can't find much to say on this. Goodbye for now. Bonsoir!

No comments:

Post a Comment