DEV Community

Cover image for Best CSS Reset
Vishal Vansjariya
Vishal Vansjariya

Posted on • Updated on

 

Best CSS Reset

A CSS Reset style is a list of rules that 'reset' all of the default browser styles.

This CSS reset style is not standard, although any CSS reset is not standard. I followed this CSS reset most of the time. This reset has my personal touch, so this is very subjective.

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
  font: inherit;
}

::-moz-selection {
  background-color: #b3d4fc;
  color: #000000;
  text-shadow: none;
}

::selection {
  background-color: #b3d4fc;
  color: #000000;
  text-shadow: none;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  height: 100%;
}

html,
body {
  min-height: 100%;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  display: inline-block;
  text-decoration: none;
}

svg {
  display: inline-block;
  max-width: 100%;
}

img,
picture,
video,
canvas {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  border-radius: 0;
  border: none;
  background-color: transparent;
}

input,
textarea,
select {
  color: inherit;
  letter-spacing: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeSpeed;
}

Enter fullscreen mode Exit fullscreen mode

Here is my github repository for the CSS reset stylesheet. if you like give it a star and follow.

Resources
https://www.joshwcomeau.com/css/custom-css-reset/
https://piccalil.li/blog/a-modern-css-reset/

Top comments (0)

Top Heroku Alternatives (For Free!)

Recently Heroku shut down free Heroku Dynos, free Heroku Postgres, and free Heroku Data for Redis on November 28th, 2022. So Meshv Patel put together some free alternatives in this classic DEV post.