How to reset an elements inherited properties using css?

hunzaboy

Aslam Shah

Posted on April 6, 2022

How to reset an elements inherited properties using css?

If an element is inheriting alot of css properties you can reset all properties to their unset state at once using all: unset property.

This can come handy if your element is inheriting alot of properties due to css frameworks, custom css or any third party css imports.

According to MDN:

The all shorthand CSS property resets all of an element's properties except unicode-bidi, direction, and CSS Custom Properties. It can set properties to their initial or inherited values, or to the values specified in another cascade layer or stylesheet origin.

You can read more about all property here

💖 💪 🙅 🚩
hunzaboy
Aslam Shah

Posted on April 6, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Drawing Togo's Flag with CSS
css Drawing Togo's Flag with CSS

November 19, 2024

Exploring Nesting with Flexbox
learning Exploring Nesting with Flexbox

August 30, 2024

Bad CSS-Dad Jokes (III)
css Bad CSS-Dad Jokes (III)

September 27, 2024

Bad CSS-Dad Jokes (II)
css Bad CSS-Dad Jokes (II)

September 23, 2024