HTML and CSS tips #8 "How I use the inherit keyword to reset styles"

github logo Updated on ・1 min read

You can use the inherit keyword when you need to reset the default browser styles. For example, you can reset default value of the font-family property of the button element.

Don't do it

body {
  font-family: 'Roboto', sans-serif;
}

button {
  font-family: 'Roboto', sans-serif;
}

You can use it instead

body {
  font-family: 'Roboto', sans-serif;
}

button {
  font-family: inherit;
}

P.S: I share my experience with my Linkedin subscribers. Are you interested? Join to us! 👉 https://www.linkedin.com/in/melnik909/

twitter logo DISCUSS
Classic DEV Post from Jun 25

A Metaphorical Introduction to Functional JavaScript

Functional JavaScript is my new favorite approach to writing JavaScript, but few introductions I found were beginner friendly. I break down the basics with angels, mutants, and demanding southern belles.

Stas Melnikov profile image