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
Use IDs and Classes - Not tags - for more efficient CSS?
Old 07-21-2010, 10:20 AM Use IDs and Classes - Not tags - for more efficient CSS?
TWD
TWD's Avatar
King Spam Talker

Posts: 1,183
Trades: 0
When I started out learning CSS, one of the guiding principles
was to use the existing tag hooks to target DOM elements
i.e. don't add extraneous IDs and Class names.

HOWEVER....

If you read this from Google
http://code.google.com/speed/page-sp...rendering.html

Quote:
Make your rules as specific as possible.Prefer class and ID selectors over tag selectors.
it would seem that Google wants us to use ID and Class names for better Page Speed scores.

So should we now be slapping ID and Class Names on everything?
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE
TWD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-21-2010, 10:41 AM Re: Use IDs and Classes - Not tags - for more efficient CSS?
Registered User

Posts: 86
Name: John Dacu
Trades: 0
I've read it while ago. An other good resource is on Firefox site. I haven't found right now the exact link but is there somewhere. Anyway the idea of making de selector specific as possible alows the browser to get more fast on specific element. On the other hand... this article is a little outdate because this days computers are very fast and browser benefit from this speed. If we will style every element like a div, and set all all style for every one then will end up with lot of redundat code, hard to mentain
johnny.dacu is offline
Reply With Quote
View Public Profile
 
Old 07-21-2010, 10:47 AM Re: Use IDs and Classes - Not tags - for more efficient CSS?
TWD
TWD's Avatar
King Spam Talker

Posts: 1,183
Trades: 0
Quote:
Originally Posted by johnny.dacu View Post
I've read it while ago. An other good resource is on Firefox site. I haven't found right now the exact link but is there somewhere. Anyway the idea of making de selector specific as possible alows the browser to get more fast on specific element. On the other hand... this article is a little outdate because this days computers are very fast and browser benefit from this speed. If we will style every element like a div, and set all all style for every one then will end up with lot of redundat code, hard to mentain
I agree. But it depends how anal you (or your client) want to be about improving YSlow and Page Speed scores.
__________________
RATE-MY-WEBSITE.com "Free website reviews by real web professionals"
Please login or register to view this content. Registration is FREE
TWD is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Use IDs and Classes - Not tags - for more efficient CSS?
 

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.15437 seconds with 12 queries