Quote:
Originally Posted by JSWolf
I prefer not to stick classes to anything. They are better free form. So p.hd would be just .hd. It works in all cases where CSS is respected. So no need to test .hd as the class in the CSS. Any reading software that breaks if it is just .hd is too buggy to even bother with. ADE does work with .hd so no problem there.
|
For simple rules, ADE works consistently. Where ADE tends to screw up its specificity rules is when some of those have multiple elements and other rules have just a class.
For example, given
<div class="foo"><p class="bar">...</p></div>, the CSS rule
div.foo p { ... } should have lower precedence than
.bar { ... }, but in ADE, IIRC, it doesn't. I'm not sure about
p.bar { ... }, but that
might be enough to make ADE give it precedence as it should. Not sure.
Honestly, it's likely that ADE won't ever break because of removing the p, but given the aforementioned bug, I wouldn't bet my life on it.
Quote:
Originally Posted by Jellby
I prefer to include the element name in the stylesheet, that way I know exactly what the class was originally intended for.
|
Agreed. An uncluttered CSS namespace is less likely to cause surprises later. If I'm applying a style, it is rare that I don't know in advance what element it is intended to affect.