CSS element reverts to default style

Is there a quick way in CSS to remove all styles applied to an element? For example, say the tab menu:

<div class='outer'> <div id='d1'></div> <div id='d2'></div> <div id='d3'></div> <div id='d4'></div> </div> 

CSS is applied ...

.outer { foo:blee; bar:blah; bas-bloo:snork; /*...long long list...*/ }

Now I want #d3 (for example) to return to the default style, but I don't want to explicitly disable all parent styles:

#d3 { remove-styles:all } /* <- [I made this up, obviously] */

Dream or pipe opportunity?

+1
source share
2 answers

In CSS3, yes. You can use a negative pseudo-class :

 .outer:not(#d3) { foo:blee; etc etc } 

Too bad CSS3 support is a bit lacking at the moment with most browsers ...

With a CSS level of less than 3 you are screwed. Unfortunately.

+3
source

No. Does not seem possible. Just cancel it.

+1
source

Source: https://habr.com/ru/post/1333473/


All Articles