Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove/reset CSS behavior property

Is it possible to remove the IE-specific behavior CSS property via a more specific rule or the !important declaration? Example:

.a-rule {   behavior: url(/some.htc); } .a-rule.more-specific {   behavior: /*no HTC*/ } 

I realize that overriding CSS properties is undesirable, but I'm stuck here.

On Edit: I'm not sure where people are getting confused about this question. For all purposes, you can consider this already being an IE specific stylesheet. I'm asking how, if .a-rule above exists and is immutable, how can one remove the behavior via a more specific rule? A standard CSS equivalent would be:

.a-rule {   border: 1px solid black; } .a-rule.more-specific {   border: 0 none; } 

One can reset the border property for a subset of elements via a more specific rule. I'm asking how to reset the behavior property in an analogous way.

like image 392
Jeremy Kauffman Avatar asked Dec 22 '10 21:12

Jeremy Kauffman


People also ask

How to unset CSS style?

Use the revert keyword to reset a property to the value established by the user-agent stylesheet (or by user styles, if any exist). Use the revert-layer keyword to reset a property to the value established in a previous cascade layer.

Which CSS property is used to remove all the selected element's properties?

The all property in CSS resets all of the selected element's properties, except the direction and unicode-bidi properties that control text direction.

How do I restore the default property value in CSS?

In short, there's no easy way to restore to default values to whatever a browser uses . The closest option is to use the 'initial' property value, which will restore it to the default CSS values, rather than the browser's default styles.


1 Answers

The default value is "none". See:

What is the *correct* way to unset the behavior property in CSS?

The solution:

.a-rule {   behavior: url(/some.htc); } .a-rule.more-specific {   behavior: none; } 
like image 98
Jeremy Kauffman Avatar answered Sep 21 '22 17:09

Jeremy Kauffman