Arjan Eising

Pages

Feeds

You can subscribe to my feeds to get notified when I have written a new post, using RSS or Atom.

Categories

Archives

2007 as an HTML element

I could give a list of nice blog post I wrote this year. I could post a cool movie related to web development. However, I would like to do an mind experiment on how to markup the year 2007. Oh yeah, with HTML.

2007 is in my opinion just an chain reaction of both interesting and boring things. Like always we have the option to choose, so I pick the first one. ‘Things’ is multiple, so a good start is using a list. Here we go.

The element name is, as you can see, year2007. I couldn’t find if this is an allowed name in the DTD specification, but I could just see <2007> in my browser if I used that one.

Another thing I ran into was the fact that some events are really general, but some are personal. So I also use the type attribute to indicate which one it is. The attribute can be used on the year2007 element itself, or one of the list items. So now we are talking about semantics!

Only missing is when the events happened. Okey, in the year 2007, but that is not precise enough. So the datetime attribute could be used on the list items. User agents may want to export the dates to a history e-book, for example. So have a look at the example with usage of the datetime attribute.

I am lazy, and since this is a bad joke I will not write a full DTD for all this. However, if I had written one, I could use a good validator that can read custom DTDs and Doctypes to validate the cool document I will markup later. Writing one would not be that difficult, though.

Now we have some kind of structure the list can be filled with some real events. You could expect it, I added some general and personal events that happened in 2007.

To add some style, I made a style sheet to indicate the differences between general and personal events. Since personal events are very important for me, they are a bit heavier. Just a simple CSS2 selector, nothing new invented. Check that out.

By the way, happy new year!

10 responses to 2007 as an HTML element

Respond

Post a comment

Like you, I hate spam. So your e-mail address will not be shown on this website, nor sold to the rich and notorious. For your comment you can use the daily XHTML elements: a (do use the title attribute, please), abbr, acronym, blockquote, code, em and strong. Remember, your comment needs to be written in English, and also be an useful addition to the article or other comments. If not, I might want to delete your comment.