Every once in a while I define an empty CSS class such as
.empty{}
to enable me to manipulate a whole sequence of DOM elements easily in jQuery. From what I have seen thus far all the major browsers allow me to get away with this. However, I was wondering... are there any W3C guidelines that might mean that one day browsers strip out/ignore such empty class declarations? I have scanned the, oh so dry, W3C documentation but have not been able to find anything terribly relevant on the subject.
As I understand, you just use this class as a hook to get the desired elements via jQuery. Nothing wrong with that, will work forever (or till the zombie apocalypse).
Browsers will never start and just remove any elements which are completely valid.
I am pretty gutsy in saying "never" :-D
But there is no need for a CSS-declaration for that class which has no properties at all. But it doesn't hurt either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With