...

View Full Version : Validating the <ABBR> tag



Darren
08-18-2008, 10:45 PM
Ok, the <abbr> tag isn't recognized by IE. The simplest fix seems to be to specify a namespace for the <html> tag as follows:

<html xmlns:html="http://www.w3.org/1999/xhtml">

and then generate the <abbr> tags like this:

<html:abbr title="pounds">lbs.</abbr>

I found this solution here at coding forums at the following (kinda old) link:

http://codingforums.com/archive/index.php?t-49227.html


Well, my problem now is that (as stated in the above mentioned link) the W3C validator (http://validator.w3.org/) won't validate this code. I was hoping that since a couple years have passed, maybe there is a new, improved solution to either the <abbr> problem, or in how to get the validator to accept it.

Thanks in advance,
Darren

VIPStephan
08-19-2008, 12:39 AM
More than the abbr element, IE isnít supporting XML, and XHTML for that matter, anyway. But Iíve found a simple, yet effective solution: http://www.sovavsiti.cz/css/abbr.html

jkd
08-19-2008, 04:23 AM
IE does strange stuff. Inserting the following into the <head> (before any abbr styling) solves the problem entirely:


<script>document.createElement("abbr")</script>
<style>abbr { border-bottom: 1px dotted black }</style>


For some reason using createElement() first makes unknown tags just work in IE.

Darren
08-21-2008, 12:15 AM
I have to admit that I'm baffled as to why this works, but I just tested it and it appears to resolve the <abbr> issue and it validates.

Again... baffled, but also thanks for the info.

Darren


IE does strange stuff. Inserting the following into the <head> (before any abbr styling) solves the problem entirely:


<script>document.createElement("abbr")</script>
<style>abbr { border-bottom: 1px dotted black }</style>


For some reason using createElement() first makes unknown tags just work in IE.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum