Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Class vs ID - What do you predominantly style with?
Old 03-03-2011, 05:45 AM Class vs ID - What do you predominantly style with?
Average Talker

Posts: 24
Trades: 0
What do you tend to roll with: classes (.) or id's (#)?

I've always used a majority of id's in my css, but should I maybe use more classes for their flexibility? Is there a downside to predominantly using classes in stylesheets?
EViS is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-03-2011, 07:04 AM Re: Class vs ID - What do you predominantly style with?
edgray's Avatar
Super Moderator

Latest Blog Post:
Frantic
Posts: 4,264
Name: Sugarcane Gray
Location: Hell, Southern Spain
Trades: 0
It entirely depends on a) the size of the site b) the complexity of the design and c) the purpose of each class etc.

Ordinarily I use ID's for basic layout, when I'll only be defining each section once. But for a more complex layout, I'll switch to classes, so I can reuse elements and only declare them once in a stylesheet.

For example, with rounded corners. I normally declare a class .round that I can then apply to anything throughout the site. Text colours as classes too.
__________________

Please login or register to view this content. Registration is FREE
- a project in video and sound.

Please login or register to view this content. Registration is FREE
"Absolute Rubbish, an insult to the blues." - NME.

Please login or register to view this content. Registration is FREE
- Come use our agency :)
edgray is offline
Reply With Quote
View Public Profile Visit edgray's homepage!
 
Old 03-04-2011, 06:48 AM Re: Class vs ID - What do you predominantly style with?
cbeaudin's Avatar
Extreme Talker

Posts: 158
Name: cbeaudin
Location: Proud to be Canadian
Trades: 1
You may be interested in reading this article:
http://css-tricks.com/the-difference...-id-and-class/
__________________
- cbeaudin
cbeaudin is offline
Reply With Quote
View Public Profile
 
Old 03-04-2011, 09:21 AM Re: Class vs ID - What do you predominantly style with?
Average Talker

Posts: 24
Trades: 0
Thanks guys. Guess the way I'm styling is right (i.e. use classes where appropriate and the same goes for id's) .
EViS is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Class vs ID - What do you predominantly style with?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.96514 seconds with 12 queries