This is a list of HTML elements I've found to be very poorly represented in most markup on the web today. Many of these elements offer more semantic value than actual functionality, but with the rising popularity of CSS driven design where HTML elements are used for what they were actually intended for, I felt shining a little light on them was appropriate.
-
<address>
The <address> tag was intended to contain address, signature, and authorship information. Phone and fax numbers, physical street addresses, email addresses, AIM/ICQ/Yahoo/etc, and any other online or offline contact data are all valid. Typically <address> elements are found at the top or bottom of a document.
Usage:
<address> My Company <br /> 1234 Somewhere Lane <br /> Seattle, WA <br /> Phone: (123) 456-7890 <br /> Fax: (123) 456-7890 </address>
What's the point? I can do the same thing with a <div> tag
Elements grouped with <div> have no semantic value unless they're assigned to a class or ID. Why create <div class="contact"> when there's already an element to do it for you?
Example:
address { background: url(/images/bg_address.jpg) no-repeat bottom left; padding: 35px 0 35px 35px; font-style: normal; } <address> <a href="https://moz.com/matt.php">Matt Inman</a> <br /> SEOmoz.org LLC <br /> 4314 Roosevelt Way NE <br /> Seattle, WA 98105 </address>
Output: Matt Inman
SEOmoz.org LLC
4314 Roosevelt Way NE
Seattle, WA 98105 -
<q>
Note: Apparently this little gem doesn't work in IE. Sorry folks. W3C specs it, actual attempts prove otherwise. A List Apart has an interesting article on how to make <q> work.
Many web developers (myself included) have fallen into the practice of using character entities such as &quo; to quote text. The <q> tag does this for us - it'll surround the enclosed text in quotes.
Embedded Quotation
One of the cool features of using the <q> tag is the behavior of embedded quotes. If you enlose a <q> tag within another <q> tag it'll automatically switch quotation types. The default is outer <q> elements are surrounded in double quotes and inner <q> elements are surrounded in single quotes. This is particularly useful if you're writing copy that involves heavy use of quotes within quotes, such as character dialogue.
Example:
<q>
The internet, or <q>interweb</q>, is full of bitchin content</q>,
said Matt,
<q>If I were to surf the <q>interweb</q> I'd totally do it nekkid
</q>
Output:
The internet, or interweb, is full of bitchin content, said Matt, If I were to surf the interweb I'd totally do it nekkid
Styling your quoted content
You can define the type of quotes that are rendered using the following CSS command:
q { quotes: "«" "»" "'" "'"; }
The first two values specify the first level of quotation embedding, the next two values specify the second level of quote embedding.
Using <q> instead of character entities also allows you to apply CSS styles to your quoted content such as color, font-style, font-weight, etc. -
<optgroup>
Ever had a bunch of <option> elements inside a <select> box that you wanted to group into categories but didn't want those categories to be select-able? <optgroup> does just that.
Example:
<select> <optgroup label="Mammals"> <option value ="dogs">Dogs</option> <option value ="mrrow">Cats</option> <option value ="pigs">Pigs</option> </optgroup> <optgroup label="Reptiles"> <option value ="lizards">Lizards</option> <option value ="geckos">Geckos</option> <option value ="iguanas">Iguanas</option> </optgroup> </select>
Output:
Dogs Cats Pigs Lizards Geckos Iguanas -
<acronym> or <abbr> combined with the title attribute
The <acronym> and <abbr> tags define acronyms and abbreviations. In addition to offering semantic value, using these in combination with the title attribute will show the expanded version of the expression when you hover over the element.
Example:
<acronym title="Search Engine Optimization">SEO</acronym>
Output:
SEO -
<fieldset> and <legend>
<fieldset> is an excellent element to use when grouping items inside your form. By default it'll draw a box around whatever elements it contains, combine it with <legend> to easily caption your form data.
Styling the fieldset
You can easily style your <fieldset> using CSS:
fieldset { border-top: 1px solid #efefef; border-left: 1px solid #efefef; border-bottom: 1px solid #ccc; border-right: 1px solid #ccc; padding: 1em 1em 1em 1.5em; } fieldset:hover { background: url(/images/bg_fieldset.gif) repeat-y; border: 1px solid #3A789D; }
Output:
Personal Information Name Age:
Now that I'm done writing this entry I suppose I should get started on the task of putting these elements to use on the SEOmoz site itself. :)
On a similar note, check out Sarven Capadisli's excellent post on web standards about using your better judgement when it comes to adhering to the w3c.
I use <fieldset> and <legend> whenever I make an xhtml accessible forms. They work wonderfully. I haven't used the address tag much, but I'm going to do a bit more research and perhaps start using it on all the contact pages and footers I create in the future. Nice list!
I never even knew about the address tag - thanks!
Wow, the address tag is very useful. And you forgot the marquee tag! ;)
Marquee? You can't be serious, probably the most USELESS tag ever invented.
Not everyone gets sarcasm, I suppose
Nice, I wonder if you guys know the <blink> tag.
ithink they are coming up with a text represintaion of sarcasm so we wont have this problem anytmore.. sorry for spelling im a little drunk... woojhoo drunk seomoz... the best way to practice seo...
The defintion tags are useful too <DD>, etc... Generally, it's a good idea to semantically mark up stuff based on what it is. Otherwise you get in <div> heaven.
Absolutely. FAQ pages are one obvious use for definition lists.
I've also written a little article on this topic:https://willcode4beer.com/design.jsp?set=littleUsedHtml
I tried to mention some things that can be done with the tags.One thing to consider with the <address> tag is microformats. To allow the data to be a little more useful.
I also made a page with a behavior to 'patch' IE's missing quote tag <Q> implementation:https://willcode4beer.com/tips.jsp?set=fixIEQuotes
Another severly lacking thing (in the spec?) is that nothing happens with the CITE attribute on the quote and blockquote tags, I suggested placing that url in a bubble tooltip (in that first link). At least then, a visitor to your site has the potential to visit the url.
Does anyone know if the address tag is used by the search engines for local listings? AKA Google Local?
I seem to remember that all you need to do is include you address on every page of your site (To insure it will be seen and included). It seems that it would make sense for Google to look for the address tag though.
To get listed yourself you have to go through this listing process. I'm not sure how non-submitted sites get listed though. It would indeed make sense if GG used the address tag, but I seriously doubt they do right now.
It would make sense that somewhere down the line they'll have a more organic system for Google Local - and the address field is a fantastic way to handle it.
I like the acronym tag. In a business like ours, content can be a little overwhelmed with acronyms.
Great tips, I didn't realise any of those existed! :)
It's posts like this that make me realize I never knew HTML. Time to go back to the drawing board again. At this rate, I'll never learn PHP! :)
As said - Dont use the Address element like that - see https://tantek.com/presentations/2005/03/eleme...I got it wrong as well and have changed over recently. - I can't prove it at the moment but I avoid using for quotes. It is unsemantic just like using <b> instead of <strong>. I use blockquotes even for short quotes. - also I have stopped using acronym. I only use abbr. acronym will be depreciated. It is very confusing and really an acronym is an abbr. (see https://www.smackthemouse.com/20040108#h21) - The tags you suggest though for forms are verygood and underused. All this is my humble opinion but I try to keep an eye on the leading thinkers on this. One source I use is www.webguidelines.nl/english but it is down for revision at the moment
Another gem: tag, for examples of things that the person types in.
Whoops, looks like our blog comment system ate your tag - it strips out all HTML tags except b,i, and a.
What was the tag you were referring to?
Thanks for the info on those tags! I've used fieldset before and didn't find it useful, but that's probably because I was more focused on the visual design of the page and not with its usage through alternative methods, since I design forms for internal use in my office that are only viewed through IE or Firefox. Of the mentioned tags I was definitely suprised to hear about <OPTGROUP>, and I plan to use that one. I'm not sure the others would be of any use to me though. I used IE to view your page and didn't see the underline on the <ACRONYM> tag until I tried looking at it with Firefox, but the <TITLE> tag you used did come up regardless, so perhaps it would be helpful to use the <ACRONYM> tag in combination with <U></U> around the abbreviation so that it displays properly in all browsers. Just a suggestion. Great page, one I'll definitely save for later reference!
What about the tag? Almost nobody knows about it, but it's on of the most useful tags when debugging PHP/Perl code.
is like textarea without a bounding box. It formats text exactly how you write it...
I'm thinking that Kevin meant the code tag :)
Or the <pre> tag
A little late, I’d spontaneously vote for <ins> and <del> of the “old” HTML elements.
I ran into this when investigating use of non-standard elements, however. It’s really interesting how many posts are around that suggest what elements not to use anymore (but that’s relatively easy to pin down using HTML indices—disclaimer: I run said one, a rather comprehensive one).
Thanks! I just found your article on Digg. Its great to see some of the lesser known HTML tags revamped with CSS. Bookmarked and will be put to good use on my next site.
The acronym tag is awesome! I will be using that a lot.
The quotes tag seems to be way more trouble than its worth. Thats probably because I am older than dirt, and learned how to use quotes on a "typewriter", so the usage is almost automatic.
I actually use 4 and 5 quite often. Now that I read this, I am considering in using the optgroup, I might try it out. But the for address and embedded quotes. Hmmm, maybe not.
Over a year later and I'm still preaching the <address> tag to people. I brought it up at SMX LoMo and was surprised to see how many people were A) not using it or B) had never heard of it.
There's some real gems in here - will add this page to my favourites!
If only there was a better way to do this!
Microformats are the way forward IMHO
John
This is a list of HTML elements I've found to be very poorly represented in most markup on the web today.
(see <a href="https://www.chosimsodep.net/sim-than-tai-sim-loc-phat-sim-ganh-dao-sim-nam-sinh" >https://www.chosimsodep.net/sim-than-tai-sim-loc-phat-sim-ganh-dao-sim-nam-sinh)</a> Excellent information here cause in my language, there are not much good source like this. This interesting post made me smile. Maybe if you throw in a couple of pictures it will make the whole thing more interesting.
wow thanks! great explanations! i should put them to good use...
I wonder how <!-- <abbr>--!>'s will be indexed. P.S. Thanks for Oatmeal Comics. LOL @ design_hell
Never used the optgroup, but I really like this. Thanks for bringing this to my attention!
Damned textarea ate my comment on edit ... oh well. Sorry, no time for a rewrite.
Thanks, Nice Article....
I also vote for the Definition List tag to be added to the list. I've found it quite useful in the past several weeks since I discovered it. It's not found in a lot of wysiwyg editors, but it's quite simple to use, and like I said, very useful.
nevet - fantastic! I need that tag so very badly... Many of my lists are hacks because of a lack of the ability to use an element like that. Thanks.
I see you've been dugg... Matt's always getting the credit on this blog ;)
Hey, I dugg your page scrape posting...but it didn't get too far :(
You need to write more Top 5 or Top 10 lists. Those get dugg five ways to Sunday.
psst...Rand, that's because Matt's always submitting to digg. You should try it, quite addictive. :)
If he doesn't submit it to digg I just do it for him :)
Nice to see some chatter about microformats.
Thanks for the great tips. I've been doing HTML for a long time and I still don't know all the fancy tags. :)
The FIELDSET tag is just for drawing a box around the form, right? I'm wondering if search engines would ignore the contents of a fieldset...
...then again, they don't ignore the contents of FORM, so maybe not. I want to keep that bot off the form.
While most browsers render the fieldset as a box around a group of elements, its purpose is to declare a group of elements as being related. It can be particularly useful in helping blind users to understand the relationship between groups of inputs on a form.
As far as SEs go, my guess would be that at this point none of them pay any attention whatsoever to whether a fieldset is there or not as there simply isn't any information for them to really gather there.
Makes sense.
fieldset and legend both serve an important purpose when it comes to screen reader accessibility. they are standard elements and should be used by every web designer and developer.
the rest are probably all deprecaed i would assume...
Nope, they're not deprecated. They're alive and well :)
Well..maybe not alive
FIELDSET is intended for ADA compliance.
Using markup to group the items means someone using a screenreader can still tell which fields belong in each group. The cosmetics of the tag are icing on the cake.
BTW, you can do the same thing to a TABLE using CAPTION.
Mod Outmeal UP - nice post/info. While I know this is an SEO blog, those are some useful tags for misc. user interface stuff - thanks!
and, while I am making comments :) the address element was never intended to hold a person's address - it was intended to hold a reference about the page, ie where it was from. If you are serious about semantic markup for addresses then you would do better to look at microformats (microformats.org IIRC) and hcard :)
Thats some great stuff Leadegroot.
Thx
Once again, good call. :) I modified the description of the address element. I'd initially heard about the address tag from w3schools.com where they define it as an element to contain contact data, not so much about defining authorship.
I don't think we can starting arguing that something wasn't "mean't" like that. The last update of HTML is about what, 10 years ago? The web has growed since that time with demands that wheren't forseen in that time. Arguing that microformats would solve this problem, doesn't seems to make any logic to me. It's just common XHTML in the end that it generates, and things like [div class="street-address"]Monkeystreet 1[/div] Monkeystreet aren't meant to be used in this way either. (I assume that you can fill the division explanation in yourself ;) ) But hey, the web has grown, and we need to go on. And in that way... [address] makes more sense then some a div.
I am wondering if the address field could be used to designate a country of origin. Especially in the cases of sub domains being used in particular countries without local hosting.
Unfortunately using the address tag offers no SEO benefit in terms of geolocation
(never mind, Jarrod already said my question below)
So the <address> tag is to be used only for describing the contact information of the author of the page -- it's not intended for generally marking up addresses.
Instead, use the microformat hCard.
Umm,. were you planning on addressing the cross browser issues using these elements raise? :(
Good call. I'll add a little blurb with each element indicating what browsers it's supported on. I know that IE doesn't do a few of them.
Excellent! :)
Great tip on the tag. Quite frankly, I never see anyone use it, but it is pretty useful.
hi there,
I tried I.E 6 and the tag does not work.
BR, ~A
Is it just me, or does FF and Safari (Mac) both render 'foobar' instead of the quotes in the quote example?
hehe I saw the same thing. My guess is someone was tinkering with the css.
haha..yeah, I was trying to fix the <q> tag in IE.
Apparently every browser except IE appears to support Q.
Yep, the <q> tag works in every brower but IE (even lynx!). Workarounds include:
* Use CSS to turn off the display of quotation marks for the <q> tag, then add them in manually. The deawback with this approach is that browsers that ignore CSS will show an extra set of quotes.
* Use CSS to put text within <q> tags in italics. IE users still won't see quotation marks, but at least the quotes will be distinguishable from the surrounding text. If you use this method, you should probably hide the CSS from non-IE browsers with a conditional comment.
Excellent ideas Jonah, thanks
...which is, also, typographically wrong (OK, unelegant ;) ). “ (“) and ” (”) are the right glyphs.
(Oh, and you must mean ", by the way.)
...and, with the right CSS property, employs the right quotation marks glyphs for us. :)
Also: SEO (your example) is, semantically, an abbr (since it is an initialism—it is spelt out); acronym's are those which are read as a word (examples of 's: CAPTCHA, NATO, AIDS).
(Or does it sound like you're spelling "C.O."? Really don't have ideia, I'm not a native English spaker.)
But (there's always a "but") doesn't work in IE6.
Not to be a bitch but you don't practice what you preach my friend.
https://www.seomoz.org/matt.php
Read the bottom of the post: Now that I'm done writing this entry I suppose I should get started on the task of putting these elements to use on the SEOmoz site itself. :)
Welp - following on the lead from Oatmeal - I have posted the "Worst HTML Tags of All Time" list - So far I have posted one entry -- add your own!
Worst HTML Tags of All Time List
While fieldset and legend seem the right way to go, there are serious limitations to their use. I recently had to build a page with quite a complex form which I wanted to divide up using fieldsets (https://www.carsite.co.uk/finance-calculator.html). I was prepared for degradation in IE, but it turns out that Firefox's implementation is somewhat broken, with regard to positioning of contained elements (v1.*). Also, legend could not receive styling in any browser I tried it, so is not really ready for use yet.
Just a warning, really - I applaud the idea. q is cool.
That's a very nice page. Using the Firefox Web Developer extension, the page looks good in both linearized mode and with CSS disabled.
For your issue with <legend>, you may include it and just "display: none;" to get the accessibility without the styling problems...
Another tag often forgotten is the button-tag, used to define a button inside a form, as an equivalent to <input type="submit"...>
It makes more sense when it comes to semantics and is also useful to style the button more easily via CSS - it doesn't inherit all the formattings from the other input's
IE6 appears to support <acronym> but not <abbr>.
Apparently there's a bit of controversy over abbr versus acronym
FYI - for tip number 5 - there is a great tutorial on HTMLCenter that takes those fields to a whole new level - css extreme forms :)
HTMLCenter CSS Forms Tutorial
Very nice list. There is another tag that deserves more attention: the label-tag. Very useful in combination with checkboxes and radio buttons it allows to click on the corresponding text to activate the option. label for="visa" blabla /label input id="visa" type="checkbox" name="visa"
Yep. When I found the piece on Digg, I was expecting <label> to be in there. I try to avoid using tables to layout forms, and wrapping the <input> in its own label usually gives enough of a hook to achieve this.
Very cool list. Thanks.
Yehuda