Five HTML Tags You May Not Know About
Being a self taught front-end web guy, there are occasions when I come across an HTML tag that, well, I hadn't heard of. Some of these are more useful than others; there are tags that I could probably go without knowing for the rest of my career and there are a few that I can't imagine doing without.
<pre> (text, inline)
Before I started to blog with the need to show highlighted pre, I had no clue that this tag existed. Use it to specify any type of pre. By default, most browsers will print this in the ugliest font they can find.
<ins> & <del> (text, inline)
Surely the insert and delete tags go back to the beginning of our beloved markup language, as they seem to be best used when using HTML as a word processing language, not necessarily the rich interfaces that are so common today. Obviously, they signify inserted and deleted text. The ins and del tags have two optional attributes; cite and datetime. Cite should specify the location (as a URI) of an explanation of why the insertion was made, while datetime should state the date and time of the change. By default <ins> underlines the text within it and <del> strikes through the text within it.
<caption> (table, block)
Used inside table tags, the caption tag is to be used only once and must appear right after the opening table tag. It's meant to describe the contents of the table and by default displays above the table. Style this element to get the most out of it.
<base> (link, inline)
Defines a base location for links on a page. This can come in handy if every link on your page will have a base link of something different that your base domain.
If you are just getting into HTML, or even if you have been doing it for a while, it may be worth taking a look at the W3C to see if there is anything you just haven't had a use for yet. Chances are, something may come in handy that you were not previously aware of. Additionally, getting to know all of the HTML elements will greatly improve (and simplify) the pre you write.
Labels: (X)HTML, Web Development