View Single Post
Old 01-26-2013, 03:31 PM   #15
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
Posts: 312
Karma: 1028382
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by JSWolf View Post
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 View Post
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.

Last edited by dgatwood; 01-26-2013 at 03:35 PM.
dgatwood is offline   Reply With Quote