SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: class/id

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2010
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    class/id

    can an item have both an id AND a class?? or does one trump the other? any help for a massage therapist playing in the IT dept. would be appreciated!

  2. #2
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Yes, it can. For styling purposes, the id attribute is more specific than the class attribute, and if there's a conflict between the id and class styling, the id style will be used.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  3. #3
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    Also note that an item can have lots of classes, but only one ID.


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
  •