CSS: "Classifying" by class or id
Date: 07/08/05
(WebDesign) Keywords: java
How do you prefer to use these two in your stylesheets?
Though I realize that the primary intention of the id
attribute is for use in establishing a handle in the DOM (for Javascript access, among other purposes), I will typically attach an id to an element and style it based on that handle if there's only one in my page. I take id to mean, in most cases, a singular one-instance of that type of style and class
to be the opposite: an identifier that applies to many elements. In this way, I feel there is a better logical seperation of the two.
Preferences? Thoughts?
Source: http://www.livejournal.com/community/webdesign/924061.html