Using CSS to Subvert HTML

December 9th, 2007

One of the weird but cool things I’ve learned about Cascading Style Sheets so far is that it can be used to subvert the very purpose of a particular HTML tag.  OK, what I really mean is that CSS allows the webmaster to customize any particular tag to do what he or she wishes it to do stylistically.  That’s great, but if you have a long history using HTML like I do, it’s a bit shocking that <b> doesn’t necessarily make stuff bold.  Come on…<b> was designed to make words bold!   Why mess with a good thing?  I suspect that most people don’t, but for some reason I felt a desire to make <b> mean something else tonight.  Using a bit of CSS, I let <b> function as a new type of tag that makes text green, italicized, and underlined.  It was very strange, but also liberating in a way.  If I use CSS, I get to decide what my tags will mean.  In all likelihood, I’ll probably be rather conservative and not subvert too many HTML tags in the future quite as drastically as that, but it’s really cool to know that I have the ability to customize my tags as I like.

Although I do think that CSS will make me a more efficient web publisher in the long run, I can also see how CSS could be used to make your life harder if that is what you want.  If you customize your tags to such an extent that even you have a hard time remembering what they do, then you’re not exactly in control of your own design anymore.  If you customize your tags very differently from page to page or site to site, that could also confuse you.  So it seems to me that to use CSS efficiently one must strike a balance between having fun with customizing and building a design framework that you’ll be able to function in the next time you need to edit your page or site.  To not customize at all would be not to take advantage of something that CSS makes easy, and it would also be stultifying.   Too much complexity, however, could very well make editing and updating into a confusing chore.