January 15, 2004

Styling <abbr> in IE

<abbr> is the proper markup for abbreviations, but IE doesn't support it. It does support <acronym>, but ignores <abbr>. Thanks Microsoft. But the tag isn't worthless. It's important for accessibility purposes, and other browsers (Moz, Opera) handle it properly. Marek Prokop has written a very helpful article on Styling <abbr> in IE. The core solution lies in wrapping the content of <abbr> in a <span>, and then uses CSS to style it proper. Nice. But it gets better. You don't feel like re-marking up your content? Don't blame you. I wouldn't. But he does provide a most-excellent JavaScript that automates this for you. Done.
Post Info

Tagged As CSS, HTML, Javascript

Comments are Open (2)

Posted at 07:29 AM

Comments

Anne

Problem is that you can't add additional attributes.

Tony

True, but as this is more or less a hack for IE, that doesn't bother me. The automation feature is nice and small, and will address this hack fairly painlessly.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Search
Comments on this post
Categories
Info
Tony Stephens
Copyright © 1995-2005
Site Version:
10
Licensed:
Creative Commons
Validate:
XHTML, CSS, 508, RSS
Subscribe
Blog-Fu, Link-Fu