3 ms·
Is there a performance difference between using "div#container" and "#container"? When reading the css, I find it easier to be reminded that the element with th
by ufukbay 14y ago
Is there a performance difference between using "div#container" and "#container"? When reading the css, I find it easier to be reminded that the element with the id container is a div element, but I guess its an additional check for the browser right?
- csswizardry 14y agoQualifying selectors like that is always a bad idea because: 1) What if you ever need to use the selector on a different element? 2) A performance hit (though so slight it might as well not matter) 3) Increased specificity I have written a lot about CSS selectors: http://csswizardry.com/2012/05/keep-your-css-selectors-short/ http://csswizardry.com/2012/05/keep-your-css-selectors-short... http://csswizardry.com/2012/07/quasi-qualified-css-selectors/ http://csswizardry.com/2012/07/quasi-qualified-css-selectors... http://csswizardry.com/2012/07/shoot-to-kill-css-selector-intent/ http://csswizardry.com/2012/07/shoot-to-kill-css-selector-in... H
- ufukbay 14y agoThanks for the reply and the links, I will check them out. :)