Do I only need to reset margin and padding values to not be affected by the user agent stylesheets?
resetting margin and padding values either with the universal selector (
*) or the
body selector is the most common and minimalist reset. Most often for simple pages, it will work perfectly, so it can be the only properties that we may need to reset, but they might not be the only properties that we might want to reset.
For example: in Internet Explorer, buttons and inputs have a default
overflow value of hidden, but it is valuable to set it as visible and be able to address the overflow as we see it fit. Another example can be
textareas have different font styles on each browser. Giving them an
inherit value to their
font-family property and a
100% value to their
font-size will equalize a base to implement our planned styles in those elements without differences provided by each user agent.
Presently, there are many ready-made reset CSS files out there, all worth exploring, but most often than not, when we are still learning… this:
margin: 0; padding: 0;
either for the
* selector, is more than enough reset.