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
I personally do the direct opposite of your coworker - I only add an
element to the selector when there is a specific reason to do so. In
the long run I've found that it's easier for maintenance - if an
element is changed you don't have to track down the CSS to update the
styles.
For example, if you have a class on an OL and later turn it into a UL,
your coworker has to update the code and the stylesheet.
Similarly, I've noticed some people use IDs when a class would be more
appropriate - I only use IDs for elements that should specifically
only appear one time. Often an element is the only current instance,
but could easily be joined by another later on. Then to add more
instances you have to add each ID or convert to classes.
Just my 2c.
cheers,
Ben
--
--- <http://www.200ok.com.au/>
--- The future has arrived; it's just not
--- evenly distributed. - William Gibson
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************