Completely reset css class inside @media screen

I have a menu bar for a main site with a lot of CSS, but for smartphone users, I want to completely redesign the menu bar. I do this by using @media only screen and (max-width: 767px) {}

and modifying the properties of the classes there, however everything inherits from the original class and it is a real pain to reset every single property for every class manually.

So, I was wondering if there is an easy way to reset a class in CSS when using @media only screen and (max-width: 767px) {}

0


source to share


1 answer


There is a property to reset all CSS properties all

.

.classname {
    all: initial; /* or unset */
}

      

initial . This keyword indicates to change all properties applied to an element or parent to their initial value ...

unset . This keyword indicates to change all properties applied to an element or parent to their parent value if inherited, or their initial value if not ...



Browser Support: Chrome 37+, Firefox 27+, IE 11+, Safari Not Supported

More details: https://developer.mozilla.org/en-US/docs/Web/CSS/all

+4


source







All Articles