Skip to content

The Shortest and Most Aggressive CSS Reset

Published: at 04:42 AM

Because it is very common to provide our own implementations of buttons, links and so on, I tend to reset every element’s view to … nothing. Simple text, no background, same font size and family, etc.

Here’s the snippet:

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  border: none;
  text-decoration: none;
  font: inherit;
  color: inherit;
  background: transparent;
  line-height: inherit;
}

*:focus,
*:focus-visible {
  outline: none;
}