ID and class in CSS?

Reply

Join Date: Feb 2009
Posts: 7
Reputation: sereYboth is an unknown quantity at this point 
Solved Threads: 0
sereYboth's Avatar
sereYboth sereYboth is offline Offline
Newbie Poster

ID and class in CSS?

 
0
  #1
Jul 1st, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 11
Reputation: siji44 is an unknown quantity at this point 
Solved Threads: 1
siji44 siji44 is offline Offline
Newbie Poster

Re: ID and class in CSS?

 
0
  #2
Jul 1st, 2009
ID can be used only once in a page but class can be repeated any number of times.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 20
Reputation: drumichael87 is an unknown quantity at this point 
Solved Threads: 0
drumichael87 drumichael87 is offline Offline
Newbie Poster

Re: ID and class in CSS?

 
0
  #3
Jul 1st, 2009
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)
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 234
Reputation: macneato is an unknown quantity at this point 
Solved Threads: 20
macneato's Avatar
macneato macneato is offline Offline
Posting Whiz in Training

Re: ID and class in CSS?

 
0
  #4
Jul 1st, 2009
Both answers are completely correct. Rule of thumb though, IDs are unique, classes aren't, hence only using them once in a page.
If this reply solved your problem, please add to my reputation and don't forget to mark this thread as solved.
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 7
Reputation: sereYboth is an unknown quantity at this point 
Solved Threads: 0
sereYboth's Avatar
sereYboth sereYboth is offline Offline
Newbie Poster

Re: ID and class in CSS?

 
0
  #5
Jul 2nd, 2009
Thank everyone I see!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum


Views: 446 | Replies: 4
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC