4 ms·
is there any good way to avoid using IDs as selectors? i'm working on my first large web project in a while. i'm using Compass/SASS (looks like you are too, o
by unshift 15y ago
is there any good way to avoid using IDs as selectors?
i'm working on my first large web project in a while. i'm using Compass/SASS (looks like you are too, or at least blueprint) to try to make things easier but i am finding that the HTML/CSS part of this site is such an incredible time sink.
my approach has been coupling the HTML and CSS almost 1:1 except where there are obvious re-use cases (which i'm not yet great at identifying, two pages in). this is probably bad but is there really a better way? i'm finding everything needs its own div in order to be positioned correctly across browsers and so i end up with container divs, then inner divs for padding purposes, then divs for each element, etc. it's a mess.
and don't get me started on the complete impossibility of consistent selector naming scheme...
- mindhunter 15y agoRegarding your first question: you can perfectly replace every id with a class. Writing object oriented is another thing. Personally I don't. Most CSS is very specifically written. It makes sense for real huge projects though.