On 10 May 2007, at 16:08:49, russ - maxdesign wrote:

Initialisms are subsets of abbreviations. So theoretically this should be
marked up using the <abbr> element:
<abbr title=" Metropolitan Statistical Area">M.S.A.</abbr>

The problem is that the <abbr> is poorly supported by IE5 and IE6. This means you may have to (1) revert to using the <acronym> element, or (2) place a span inside your <abbr> element and style this instead or (3) use
JavaScript:
http://annevankesteren.nl/2003/08/improved-styling-abbr-in-ie

If using JS is acceptable (and it will only exclude a tiny proportion of visitors to most sites), then you can force IE 6 (and probably 5.x) to correctly parse "<abbr>" such that it can be styled (there's no default styling) by executing the following line of code before the page is parsed - that is, either using inline script in the head, or an external script file containing this line:

document.createElement("abbr");

This causes IE to correctly make the contained text a child of the abbr element, and omit the creation of a DOM node called "/abbr" - I described this bug some time ago at <http://www.nickfitz.co.uk/2005/05/17/obscure-internet-explorer- bugs-1-of-who-knows/>.

It seems as if the use of "createElement" makes IE assume that it had better act as if it understands the name of the created element, even though it doesn't. This is why the line of code must be executed before the <abbr> is parsed - in fact, I have a test case demonstrating that if the JS comes between two paragraphs each containing an <abbr> then the first will be incorrectly parsed and the second correctly parsed (in the sense of creating a valid DOM construct).

I gave a presentation about this at BarCampLondon2, but haven't yet got around to blogging it - I'll get it written up over the weekend and post a link back here, to give those interested a fuller understanding of what appears to be going on in the bowels of the browser.

Regards,

Nick.
--
Nick Fitzsimons
http://www.nickfitz.co.uk/





*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to