Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ID and CLASS ??

Status
Not open for further replies.

DAVIDOCEAN

Technical User
Dec 18, 2005
2
MY
I'm a css newbie, like to know what is the diffrent between "id" and "class". How, and when to use them. Thanks.
 
Ids are unique identifiers that should be used to identify a single element.

Classes are identifiers that can be used more than once, so when you have a rule you want to apply to multiple elements, you would use a class, not an ID.

About the only other difference is their specificity, but I wouldn't worry about that right now - it's quite advanced stuff.

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top