Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2005
    Posts
    59
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Validating the <ABBR> tag

    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/sitemap/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

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,698
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    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

  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    IE does strange stuff. Inserting the following into the <head> (before any abbr styling) solves the problem entirely:
    Code:
    <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.

  • Users who have thanked jkd for this post:

    Darren (08-21-2008)

  • #4
    New Coder
    Join Date
    May 2005
    Posts
    59
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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

    Quote Originally Posted by jkd View Post
    IE does strange stuff. Inserting the following into the <head> (before any abbr styling) solves the problem entirely:
    Code:
    <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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •