Using * selector in stylesheet for reset styles

For now, I'm just returning the styles that I need at the top of my stylesheet, for example:

html, body, div, fieldset, form, h1, h2, h3, h4, p, ul, li {
    margin: 0;
    padding: 0;
}

However, I have seen many times that people use:

* {
    margin: 0;
    padding: 0;
}

Everything seems to be simplified, but somewhere else (I don’t remember where ...) I read that using the selector * seriously affects performance.

It is true that it makes a long list of selectors (an example has several selectors, it may be more) performs much better than the selector *, and are there possibly other disadvantages in the * selector?

+3
source share
3 answers

- , * {} reset , - Meyers, YUI no reset .

* {} reset , , IE , , -.

+2

CSS reset, Eric Meyer YAHOO '?

+4

Google, . , , reset. , , .

+3

Source: https://habr.com/ru/post/1714106/


All Articles