One of the guys here at work puts the tag name in front of all his CSS selectors for element ids. For example:
div#footer {
}
This, as opposed to just:
#footer {
}
His rationale is that this is a quicker lookup for most browsers because they don't need to check the id
attributes of every type of element--just div
elements. He also points out that this should be done with classes (e.g. div.header-label
for <div class="header-label"...
elements).
Sounds reasonable and rational, but is it true?
Your co-worker is wrong, it's exactly the opposite:
But also have in mind that CSS optimization is micro-optimization and finally just irrelevant in most cases: