This post is following on from 10 Rare HTML Tags You Really Should Know which was published on Nettuts+ a few days ago. If you haven’t read that article, then perhaps you should before going any further here.
The great thing about the article is that its author (Glen Stansberry) considers each item in the list as rare
and thought them noteworthy enough to write an article stating that we really should know about them (cf. rare tags that we shouldn’t know about!). I’m going to just come out with it, any HTML author worth their salt should be familiar with the vocabulary of the language. If the items posted in the article come as a surprise to you, perhaps it’s time to sit down and take a look at the specifications of your chosen HTML set (HTML 4.01, HTML 5, XHTML 1.0 and so on) which may not be particularly light reading but you don’t have to absorb everything in one go.
Note that this blog post uses the word tag and element for what might appear to be the same thing. However the tag is used to mark the start/end of an element. Given <p>Hello world.</p>, the opening tag is <p>, the closing tag is </p> and the paragraph element is everything including the opening and closing tags. On to the article itself: I’ll take some key points and give my own thoughts.
cite
All of us will be familiar with the <blockquote> tag, but did you know about <blockquote>’s little brother <cite>? <cite> allows you to define the text inside of the element as a reference.
Glen gets this right in his example since the cite element is meant to be used as a reference to the title of some work—not a person, animal, etc..
Good Example
In <cite>10 Rare HTML Tags You Really Should Know</cite>,
Glen Stansberry informed us about 10 HTML tags.
</p>
Bad Example
<q>Rel can be an <em>insanely useful</em> attribute</q>,
said <cite>Glen</cite>.
</p>
optgroup
Glen says that, “The <optgroup> tag is a great way to add a little definition between groups of options inside a select box
“. More concisely, I’d say that the optgroup simply groups options. The example given by Glen is not a correct usage of this element. The optgroup should be wrapping the options within the group, not merely placed before them as some kind of divider.
acronym
According to Glen the acronym element is, “a way to define or further explain a group of words.
” Not true. The acronym element does what it says on the box: it is for acronyms (those being words formed from the initial letters of a name, e.g., NASA and laser). As for Glen’s example, “Twitter
” is not an acronym of “Founded in 2006
“.
address
This section of the article is a little vague and neglects to point out that the address element isn’t for marking up just any address. Its intended use is to provide contact information for the document (or a section of it). The contact information can be an email address, another web document, a postal address and so on. It is not intended to mark up any old address or contact details, just contact information for the current page/section.
ins and del
These elements are pretty straight-forward, they mark changes to a document. To make these elements useful, use their datetime attribute to denote the date and time when the changes took place.
label
Personally, without any evidence to back this up, I really don’t think that the label element is “one of the most forgotten
” elements. It would be really disheartening if it was underused (to the point of being forgotten!). Almost every form that I mark up has thorough use of labels attached to the various input elements, I just figured everyone else also used them all of the time. Do you?
fieldset
This “nifty little attribute
” (don’t you mean element?) groups fields into discrete sets—again pretty straight forward. However the example offered in the article isn’t particularly useful as there are a number of problems with it: e.g., the form element needs an action attribute and label elements should be used for the radio buttons and their associated text labels. Really, what’s the point of saying, “hey, you should know about this element!” and proceeding to give a bad example of using it?
abbr
This tag is itself an abbreviation and is intended to denote exactly that. For example, Mr.. Again, I’m not sure where Glen gets the impression that this element is rarely used (perhaps he can link me to his source(s)); perhaps underused, yes I’ll admit, but rare?
rel
This article is about HTML tags
but here is an attribute which Glen considers, extremely useful
. The article approaches this from the perspective of using the attribute as a hook for JavaScript and completely neglects to mention their perhaps wider use on link elements (to point to alternate, stylesheets, etc.) or in navigation (prev, next, nofollow).
wbr
I don’t think I have ever used the wbr element out in the wild having never had the need to specify a point at which some text may wrap where it otherwise wouldn’t. Will there be a spate of people rushing out to push this element into their documents? I doubt it. Glen also points to a page on quirksmode about the wbr tag showing that there’s not (at the time of writing) a single cross-browser way of implementing this kind of behaviour.
Others?
There are probably a bunch of other even more rare HTML tags that you should really know about (but perhaps will never or only rarely use): things like dfn, kbd, samp, var, to name a few.
P.S. Feel free to write your own “Comments on “Comments on “10 Rare HTML Tags You Really Should Know”"” because I’ve undoubtedly made my own mistakes above.
1 Comment on Comments on “10 Rare HTML Tags You Really Should Know”.
Have made use of one or 2 od these but several i was not aware of – thanks