Page is a not externally linkable
- Code, Content, and Presentation
-- CSS
---- Is it bad form to use IDs for solving CSS weight problems?


rocknbil - 4:57 pm on Feb 21, 2012 (gmt 0)


I wrap each part of the loop in its own ID as a means of increasing the weight of the styles applied. But is this a bad way of doing it? It feels like a lot of extra code.


Yeah Wordpress themes drive me nuts. :-\ There's always a ton of selectors that aren't even used anywhere on some sites. The global reset seems to be a common approach, and I despise it. Documents have a natural flow, work with them and modify it as required. I have a few WP sites under my belt, some of which I've "cleaned up" so I use those as a baseline building out new themes. Generally my WP theme CSS ranges from 400 - 700 lines. </rant>

Can you first back up and see if there's some descendant method you can apply, like this?

.outer .content .post .some-class p a {}

That's excessive in a different way, but it may be specific enough to suit your needs. Personally I always try to take the path of least resistance, modifying the theme files as little as possible - if anything, stripping out a bunch of stuff (which is really a redesign, as alt131 says . . . )


Thread source:: http://www.webmasterworld.com/css/4419833.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com