Michael,

I think it's fine when applying to divs and I often do it myself, but
wouldn't make since to apply to non div elements...so in short, I
agree with you :-)

On 1/25/07, Michael Turnwall <[EMAIL PROTECTED]> wrote:

I have a co-worker, that whenever he creates a class, puts "div" in front of
it if the class is being assigned to a div. Here's an example:

div.container {
 background-color: #fff;
 margin-bottom: 18px;
}

div.container div.container_inner {
 border: 1px solid #bbb;
 margin-left: 8px;
}

div.container div.inset {
 padding: 3px;
}

As you can see, the code can get messy rather quickly. He says he does it to
avoid conflicts. My argument is that you should only do that when you
specifically want the class only to apply to a div. If I want to use the
class on another element I can't without creating a new rule. I would think
the better way would be to create the class without the "div." part first
and in the future add the "div." part if I need to be more specific. This
allows the CSS to be more generic and cleaner.

Any thoughts? Do you think the above code is good, bad, doesn't matter and
why


--Michael Turnwall
visit me at turnwall.net


*******************************************************************
List Guidelines:
http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe:
http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************


--
::Bruce::


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to