Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset element with a rule (delete all element styles on one class)

Tags:

css

I was wondering, is there any CSS rule to reset an element style?

It would be great to be able to use just with one class like .reset.

Any suggestions?

like image 662
itsme Avatar asked Nov 30 '25 12:11

itsme


1 Answers

You can create a single CSS class that will "reset" styles to whatever you want:

.reset{
  border:0;
  padding:0;
  margin:0;
  font-weight:normal;
  /*etc.*/
}

Then apply to your elements:

<h1 class="reset">...</h1>

Is this what you are after?

Just keep in mind that the first "C" in CSS stands for Cascading and thus you may need to be more specific in the CSS to overcome other styles applied to an element. CSS Precedence reference.

like image 188
scunliffe Avatar answered Dec 03 '25 11:12

scunliffe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!