Mr Speaker

Where the HTML4.0 did they come from?

disk driveOn some days you learn something new every day. For me, today was like 20 of those every days.

Being a particularly delightful Sunday morning, I decided to look up the HTML4.01 specs on W3C. My findings shocked and amazed me.

Now, I'm not claiming to be some kind of know-everything-about-html guy... But I mean, I first learned HTML in like, 1993. I've outlived the BLINK tag; I was there during the days when tables where only used to display tabular data - before they weren't, then were again; and it was oh-so-long-ago since I learned about TH, TBODY and TFOOT tags. Surely by now I would have somehow and somewhere seen everything? Surely!

Not even close. Running through the Index Of Elements of the specs turned handfulls of non-deprecated tags I ain't ever heard of. I'll list them from the most boring, to the the most interesting ones I found.


The KBD, VAR, DFN and SAMP tags

These are part of the list of phrase elements which add structural information to text fragments. They are defined along side of the EM, STRONG, CITE, CODE, ABBR, and ACRONYM tags - which are all the rage these days.

<KBD> Indicates text to be entered by the user.
That must have seemed darn important at the time the specs were created. When every single web page was about learning Unix. Maybe now they should have a CLICK tag or something.

<VAR> Indicates an instance of a variable or program argument.
Another useful one. Where would the disneyland web site be with the VAR tag?

<SAMP> Designates sample output from programs, scripts, etc.
Are you starting to see why these ones never made the big time? I'm a programmer and they're making me sleepy.

<DFN> Indicates that this is the defining instance of the enclosed term.
I don't know, and don't even care any more. Lets skip the phrase elements hey. Here's another slightly more interesting one I didn't know about...

Q: the quote tag

The quote tag is partner-in-crime with BLOCKQUOTE, but it doesn't indent like its big brother. Its an inline element, so indenting really wouldn't make too much sense anyway.

What it does do however, is automatically add in quotation marks for you. Think of the time that'll save! It's supposed to handle nested comments too - adding single quote marks for the nested quote.

They don't seem to work in IE though. And Firefox doesn't do the single quotes on nested comments. C'mon guys... don't you read the specs?

Here's an example of nested Q tags: A great man once said You know, a great man once said A great man once said...

I didn't put those quote marks in there. The magic Q tag did.

Marking document changes: The INS and DEL elements

INS and DEL are used to mark up revisions in your HTML document, a-la Microsoft Word's Track Changes function.

I think these two guys could have a big future with the web standards crowd (assuming they aren't a hit already). Past changes and new additions can be annotated using the cite (who made the change/for what reason etc) and the datetime attributes - giving the complete history of the document over time.

The only problem with using them in practise - on say, the Official Home and Away Web Site - is that they are marked in a very visual way. Here's an example:

My favourite new tags I have learn't are the KBD and VARINS and DEL tags.

Deletions are struck out, and additions are underlined. Like Track Changes. But if you hid the deletions, and un-underlined the inserts, it could be a pretty nifty feature of your site - with "past version" buttons that un-hid deletions. Or whatever.

Fieldset

I still can't believe this one exists. It was actually a co-worker who told me about this one. I refused to believe. He challenged me to look it up on W3C. This blog post, and the price of a Coke, was the result.

What's a fieldset?

This is a fieldset. Fieldsets allows authors to group thematically related controls and labels

Well, whatever, but holy-cow... Where did this thing come from? Fieldsets are defined with the <fieldset> tag. The heading is set via the <legend> tag.

Fieldsets are documented under the Forms section of the specs, so I guess they are only supposed to be used with forms. I think that's more of a guideline than a rule though.

Of course, once I found out about it, I've seen them everywhere. Heck, I'm posting this from WordPress and the admin page is covered in them. If this exercise has taught me nothing else, it's to start paying more attention.

That's about it

After I'd gone through all the elements, I started to have a look at the attributes. This made me woozy so I stopped. Once I get over the euphoria of the fieldset I'll revisit them. Hmm, and maybe the javascript spec too... I'll let you know if I find any juicy ones.

8 Comments

  1. Yes fine sir, fieldset is one of my favourite xHTML elements, along with its accompanying legend. Check out KFC Australia’s contact form. Here fieldset is used to logically delineate discrete form components to the user, and it helps to present it in a way that is not just one big mean form. Further, in xHTML (I know you’re talking about HTML 4 but really, who cares about that…) you need block elements within your form to validly contain your labels and inputs, etc. Also, when you’re like me and looking for as many semantically correct hooks to tie your CSS to, fieldset is a winner.

    Another interesting, ofttimes misused and obscure tag for you is the address tag. It is not just used for any old address, but specifically for the contact details of the owner/publisher of the document.

    Monday, October 10, 2005 at 10:31 am | Permalink
  2. Here was an interesting effort to fix up the Q tag problem in IE

    Tuesday, October 11, 2005 at 10:42 am | Permalink
  3. OMG, I thought I knew every HTML tag in the knoen universe… but I was wrong … very very wrong… I’m gonna start looking for a new line of work immediately…

    Monday, December 19, 2005 at 12:40 pm | Permalink
  4. Well, it may be so that you cannot find a real use of some tags, but a lot of people in different fields do, do not learn all HTML, only the part you need when you need it, i am sure one day, HTML will have tags to describe everything, and no, the way it looks has nothing to do with it, the way the browser understands it is all what matters, because you use an internet browser, there are braille browsers, PDA browsers, PRINTED output … by having the right tags, it is going to be 10% of an effort to customize for other browsers… so “q” is going to be read by all browsers “even browser readers” as “quotation of somebody” … “end quotation”, the quotes are not the point!

    Wednesday, December 21, 2005 at 12:28 am | Permalink
  5. Nice. They’re all new to me as well, and it really surprises me that I haven’t heard of fieldset and legend before or seen it in action–but I might have for all I know.

    Thanks.

    Monday, January 9, 2006 at 11:39 pm | Permalink
  6. On the quote tag you note: “And Firefox doesn’t do the single quotes on nested comments”.

    Well, you might have been right, but you now longer are. For your example, you state that you didn’t put in the quote marks by hand. However Firefox 1.5 gives you the alternating double/single marks.

    There you go. As time passes, even if you tell the truth, you may be called a liar.

    Monday, February 6, 2006 at 7:57 am | Permalink
  7. Interesting!
    And to hank: Really good use of

    Monday, February 6, 2006 at 8:03 am | Permalink
  8. <fieldset>

    Monday, February 6, 2006 at 8:03 am | Permalink
Captcha! Please type 'radical' here: *
How did you find this thingo? *