943,960 Members | Top Members by Rank

Ad:
Jul 1st, 2009
0

ID and class in CSS?

Expand Post »
Hello everyone!
what is different bettween ID(#name) and class(.name) in CSS?
but i think it is the same!


Pleae tell me!
<URL SNIPPED>
Last edited by peter_budo; Jul 1st, 2009 at 1:07 pm. Reason: Keep It On The Site - Do not manually post "fake" signatures in your posts. Instead, you may create a sitewide signature within the user control panel.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sereYboth is offline Offline
7 posts
since Feb 2009
Jul 1st, 2009
0

Re: ID and class in CSS?

ID can be used only once in a page but class can be repeated any number of times.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
siji44 is offline Offline
12 posts
since May 2007
Jul 1st, 2009
0

Re: ID and class in CSS?

You would use ID for something that will be used only once per page, like wrapper , header or footer .

Class can be used as many times as you desire, and would be used for something like post_title , post_content or post_metadata .

(blogishly speaking)
Reputation Points: 10
Solved Threads: 1
Light Poster
drumichael87 is offline Offline
33 posts
since Jun 2009
Jul 1st, 2009
0

Re: ID and class in CSS?

Both answers are completely correct. Rule of thumb though, IDs are unique, classes aren't, hence only using them once in a page.
Reputation Points: 46
Solved Threads: 48
Posting Pro in Training
macneato is offline Offline
414 posts
since Jun 2007
Jul 2nd, 2009
0

Re: ID and class in CSS?

Thank everyone I see!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sereYboth is offline Offline
7 posts
since Feb 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Virus in Mine website (Help)
Next Thread in HTML and CSS Forum Timeline: adding mutliple images to an CSS background





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC