3 ms·
"Don't use IDs in selectors". What? I need my CSS fast, Ferrari fast. I don't need toddlers to be able to have a mental model of all my style rules.
by BasDirks 15y ago
"Don't use IDs in selectors".
What?
I need my CSS fast, Ferrari fast.
I don't need toddlers to be able to have a mental model of all my style rules.
- pornel 15y agoI don't agree with this suggestion either, but I don't think IDs have significant speed advantage: • browsers support duplicate IDs already (try `<p id=foo></p><p id=foo></p>` and you'll find that `#foo` styles both) • both IDs and classes can be preprocessed and looked up using hash tables or similar https://developer.mozilla.org/en/Writing_Efficient_CSS https://developer.mozilla.org/en/Writing_Efficient_CSS — suggests that Gecko optimizes class lookup as well