4 ms·
"What does .class.class do" It selects elements with the class `class` that also have the class `class`. The example might be a little abstract but it could be
by tdrdt 5y ago
"What does .class.class do"
It selects elements with the class `class` that also have the class `class`. The example might be a little abstract but it could be something like `.message.highlight`, which selects all elements with the class `message` that also have the class `highlight`.
Classes are for classification, IDs are identification.
For styling you almost never need identifiers because that is not what styling is about.
<div class="message highlight">
.message.highlight {}
is much better than
<div id="highlightMessage">
#highlightMessage {}
IDs are like singletons: not reusable.
- dotancohen 5y agoI see, so he is suggesting `div.foo.bar`, not `div.foo.foo` which is how I understood it.