I have seen that it is very common that as soon as you start the css, many files start with:
*{
margin: 0;
padding: 0;
}
Used in theory so that all elements have no padding or margin. Does this really work? Because I have had many times to modify some element. I don't know if it's because I use libraries like Bootstrap, which makes elements have a series of properties.
Run works, it's been a way to reset padding and margin for quite some time . (Although I have found older sources)
However, there are reasons not to use it, the author of the same blog regretted it mere months after his decision.
The problem? Page performance decreases, this stackoverflow answer gives more information on why, but the reason is simple: The star element applies to all DOM elements, and certain web pages can have hundreds of them.
Also remember that the class/property applied to the element is the last one specified in the css, so it won't work if another margin or spacing is declared after the initial declaration.
Sure it works, but if you add bootstrap or any other css it will surely add margins to the elements it considers.
Regarding performance, tests have been done with "extreme" amounts of code and selectors like *{...} and the difference was in the order of milliseconds , the engines are already highly optimized and the load of resetting with * is negligible in css . Another thing would be to use it in JS/Jquery, there it would hamper performance considerably.