Skip to content

Instantly share code, notes, and snippets.

@csswizardry
Last active September 3, 2025 21:01
Show Gist options
  • Save csswizardry/442de89c46f7ca7389a4afbcd155a2dd to your computer and use it in GitHub Desktop.
Save csswizardry/442de89c46f7ca7389a4afbcd155a2dd to your computer and use it in GitHub Desktop.
Reset Research

margin or padding Candidates

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment