954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

CSS id/class

Hello everybody
HOWDY? I have lot confusion about using id/class in CSS. When there is a need to use id and when there is a need to use class? What is the difference between id/class in CSS.Either there a standard way for the naming convention in css for the id/class that has to be reference by HTML? or its up to the developer?
Thank you all.

througheye
Newbie Poster
17 posts since Sep 2008
Reputation Points: 10
Solved Threads: 2
 

Think of a class as a class in school. The class contains many students. Think of id as a unique student in the class.

Use a class when you have many elements that need the same style applied.

Use an id when the element will only be used once on the page. Things like a banner, navigation bar, or footer are commonly only used once per page.

buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
 

yeah i guess its solved thx to buddy lee

wickedsunny
Junior Poster in Training
97 posts since Oct 2008
Reputation Points: 10
Solved Threads: 5
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You