Categories
CSS

How to reset/remove CSS styles for element only?

Spread the love

To reset/remove CSS styles for element only, we set the all property.

For instance, we write

#someselector {
  all: initial;
}

#someselector * {
  all: unset;
}

to select the element with ID someselector and the elements inside.

We use all: initial; to reset the styles for the element with ID someselector.

And we use all: unset; to reset the styles for the elements inside the element with ID someselector.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *