When the Template is Broken

Written By: Timothy Fish Published: 7/7/2009

One of the fundamental tenets of HTML/CSS is that the content of a document should be separate from the formatting of the document. Sometimes that is easier said than done. It isnít that we disagree with it, but in our haste, we might choose to ignore it. This can create problems, but we do it anyway.

Let me give you an example. Suppose you have a blog and youíre using someone elseís template. Sure, it looks exactly like everyone elseís, but you donít really care. All you want is something that works and allows you to write posts. Your first few posts go fine and then you get to a longer post. You decide to break it up with heading and sub-headings. You encase the first heading with <h1></h1>, but when you look at the result, the text is now larger than the title for the post. Maybe you look at the title and it is shown in <h3></h3> tags. The easy thing to do is to just move on to <h4></h4> and let it be, but that isnít the best thing to do.

The best thing to do would be to got figure out what needs to be done to the template to make it work properly. Ideally, we would like for the title to have its own style and the headings to be progressively smaller than the title. Itís debatable whether the title should be <h1></h1> or whether the first heading after the title should be, but it should be such that when we write a blog, we donít start with <h3></h3> or <h4></h4>. If we did that, we would run out of headings very quickly. So, if you find a problem with a template, go fix the template, donít just use a ďsmallerĒ heading.