SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face What's the difference between "class" and "id"?

    I've been reading through the web and can't find any good descriptions. Could someone explain the difference between the two? And why is ID more commonly used with CSS layout?

    Thanks!
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  2. #2
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off the top of my head, as I understand it, an "ID" can be applied once per page, whereas a "Class" can be used for multiple elements.

  3. #3
    Gone!
    Join Date
    Aug 2001
    Location
    Witty Location Parody
    Posts
    3,889
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should make things clear:

    http://www.mako4css.com/BasClass.htm

    Hth,

    Glen


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
  •