FOLASAYO SAMUEL OLAYEMI
SV_D_CURIOUS_SOFTWARE_ENGINEER'S BLOG

Follow

SV_D_CURIOUS_SOFTWARE_ENGINEER'S BLOG

Follow

How to reset all styles in CSS

FOLASAYO SAMUEL OLAYEMI's photo
FOLASAYO SAMUEL OLAYEMI
·Jun 20, 2022·

1 min read

Play this article

Resets all styles to default values with one property. This will not affect direction and unicode-bidi properties.

Code Samples:

HTML

<div class="reset-all-styles">
  <h5>Title</h5>
  <p>
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure id exercitationem nulla qui
    repellat laborum vitae, molestias tempora velit natus. Quas, assumenda nisi. Quisquam enim qui
    iure, consequatur velit sit?
  </p>
</div>

CSS

.reset-all-styles {
  all: initial;
}

The all property in the code above allows you to reset all styles (inherited or not) to default values.

A9.png

Thanks for reading.

Happy Coding!

 
Share this