Micky Hulse wrote:
> [...] But when I start noticing common styles (for example: clears, 
> background colors, and/or font colors), it seems more logical to 
> apply classes to my markup like the first example (or second... which
>  is better?)

The one that works best - in each case :-)

I do add classes to ID'ed elements for certain things, but I find it
easier to maintain projects where the mix of ID and classes is at a minimum.

Your example might even end up without ID and/or class...

body div {float: left; /* plus other styles */ }
body div div {float: none; /* plus other styles */ }

...which saves a lot of bytes on multipage sites, but it depends on the
layout if it'll work.

> Now, I have read that "class-itis and div-itis" is a bad thing... 
> Would the first example be considered "class-itis"?

I think so.

> Heck, I have seen some advanced layouts by professional people that 
> use nothing but classes for page layout... is it just one of those 
> "once you know the rules, then you can break them" things?

Probably... or maybe they're just lazy (or something).
It's a "personal preference" thing - and it depends on the case whether
it's a "bad" or a "good" approach.

I think the maintenance side of any method is important.

> Basically just wondering what you guys typically do to minimize bloat
>  and streamline your css.

...use as few elements, ID, classes and styles as possible, but many
enough to make it work and easy to maintain.
OTOH: I tend to use "heavy CSS" (styling more than I "have to"), as a
mean to control defaults and get the browsers in line - with me.

Also: I streamline for browsers - not for web designers who happen to
read my source-code/CSS, since I have found out (a long time ago) that
browsers are not always all that impressed by what web designers _think_
about "how it should be done".

That often means that I style through "compacted one-liners" that are
hard to read by humans but quicker to load and easy to execute by software.
It also means that I leave out ID and classes where I can - like in the
example above, and target elements "down the chain".

It's a "personal preference" thing, I think.

regards
        Georg
-- 
http://www.gunlaug.no
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to