SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IDs & classes starting with a number

    I've just tried using a CSS class and ID that started with a numeric value and Firefox didn't want to render the appropriate CSS, although IE was quite happy to make the CSS changes.

    Does anyone know if IDs and classes are allowed to start with a numeric value?
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.


  2. #2
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, you can't start with a number but can use them later in the id or class.

  3. #3
    SitePoint Wizard rbutler's Avatar
    Join Date
    Jul 2003
    Location
    Springfield, MO
    Posts
    1,867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried it myself quickly and no, it doesn't work. I can't imagine this being valid XHTML, I don't even see how it would be valid HTML.

    The reason IE is allowing you to get away with it is IE 6 doesn't confirm to W3C standards like it should, whereas Firefox and Opera do. When developing in CSS, develop in those browsers first, then fix IE problems. I was working on a CSS layout this weekend, and did it this way, much easier to fix IE problems, than develop vice versa.
    Ryan Butler

    Midwest Web Design

  4. #4
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Curious as to why starting with a number is invalid XHTML whereas numbers are allowed in them later...

    Thanks for the input anyway!
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.



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
  •