SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    seattle.usa
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    accessible superscript dates (1st, 2nd, 3rd, th)

    Hello,
    Whats the best accessibility practice when representing special characters for dates/numbers? Specifically "st", "nd", "rd", "th" (as in 1st, 2nd, 3rd, 4th, etc).

    Are there special characters for these? Are they accessible? If not, whats the best CSS practice, or is it best to just avoid?

    Thanks!!

  2. #2
    Mouse catcher silver trophy
    Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,836
    Mentioned
    114 Post(s)
    Tagged
    1 Thread(s)
    What I would do is to use something like this:
    Code:
    3<span class="ordinal">rd</span>
    .ordinal {vertical-align:super;}
    That way, it is part of the text, any user-agent that doesn't support superscript will just see it as "3rd", and you've got all bases covered.

    (Actually, what I would do would be to just write it as "3rd", because I hate superscripts on ordinals like that, but that is just personal preference!)

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    seattle.usa
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm... i can dig it!

    very cool, dont think i've seen
    Code:
    vertical-align:super;
    before!

    always appreciate learning something new!

    and yeah - i'm a bit reluctant on the superscript usage myself.. but.. it seems to be a hard (silly?) requirement!

    thanks!!

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,021
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    okay, i'm going to expose my ignorance for the world to see here, but what the heck is wrong with SUP???
    Code:
     3<sup>rd</sup>
    it is part of the text, any user-agent that doesn't support SUP will just see it as "3rd", and you've got all bases covered

    plus, it's valid in strict doctypes, and way less "hackish" than a span
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    +1 Rudy
    Ryan B | My Blog | Twitter

  6. #6
    SitePoint Enthusiast
    Join Date
    Sep 2004
    Location
    seattle.usa
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it is part of the text, any user-agent that doesn't support SUP will just see it as "3rd", and you've got all bases covered

    plus, it's valid in strict doctypes, and way less "hackish" than a span
    cool.. now an html tag i wasnt familiar with! thx!!

  7. #7
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by r937 View Post
    okay, i'm going to expose my ignorance for the world to see here, but what the heck is wrong with SUP
    I agree. There is nothing whatever wrong with using the <sup> tag for that - after all that is basically what the tag is there for.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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