Every element in current Baseline
browsers
that would need a margin
or padding
removing in a reset stylesheet:
Element | Chrome | Chrome for Android | Edge | Firefox | Firefox for Android | Safari | Safari for iOS |
---|---|---|---|---|---|---|---|
body |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
h1 |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
h2 |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
h3 |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
h4 |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
h5 |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
h6 |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
p |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
hr |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
blockquote |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
pre |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
figure |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ul |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
ol |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
dl |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
dd |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
th |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
td |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
fieldset |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
legend |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
input |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
textarea |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
button |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
dialog |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
option |
✔ | ✔ | ✔ | ✔ | ✔ | ✘ | ✘ |
select |
✘ | ✘ | ✘ | ✔ | ✔ | ✘ | ✔ |
This means you’d need the following in your reset:
/* Text Elements */
h1, h2, h3, h4, h5, h6,
p, blockquote, pre, hr,
/* Lists */
ul, ol, dl, dd,
/* Tables */
th, td,
/* Containers */
body, figure, dialog,
/* Form Elements */
fieldset, legend,
input, textarea, button, select, option {
margin: 0;
padding: 0;
}
I do interesting little bits of research like this all the time. You should follow me for more.
N.B. There’s nothing wrong with * {}
for this purpose—I just wanted to be
extra thorough.
All tested on real devices.