The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> id vs class
minidiapolis
post Jan 28 2008, 11:07 AM
Post #1


Serious Coder
*****

Group: Members
Posts: 437
Joined: 3-September 06
Member No.: 57



Can someone help me understand the difference between ids and class? Ids can only be used once, right?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Jan 28 2008, 11:43 AM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Yes, an id value can be used only once per document. A class value can be used multiple times per document. It's the difference between "George Washington" (an id) and "US Presidents" (a class).

Also, in determining CSS specificity, #id selectors have higher specificity than .class selectors.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 11:39 AM