Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm wondering what the correct way to reset/unset the CSS behavior property is for IE.

div { behavior:url(fixIE.htc); }

I need to reset this for some specific elements. I started searching for the answer after I noticed that this does not work:

.my-div { behavior:0; }

I found an SO post that says an empty string worked, but there's no reference cited that this is in fact the correct way to do it:

.my-div { behavior:''; }

However, I've seen this used in some code I've come across:

.my-div { behavior:none; }

I cannot find any actual reference as it's not really in the spec, the closest thing I found was here:

http://reference.sitepoint.com/css/behavior

...but it doesn't clarify the issue.

Which way is correct, or does it not matter (consider javascript interaction as well, if it makes any difference)? Please include a reference if it exists - that's what I'm really looking for.

like image 485
Wesley Murch Avatar asked Oct 31 '11 12:10

Wesley Murch


People also ask

What is unset property in CSS?

The unset CSS keyword resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.

What is all unset in CSS?

unset. Changes all the properties applied to the element or the element's parent to their parent value if they are inheritable or to their initial value if not. ❮ Previous Complete CSS Reference ❯

How do I delete a property in CSS?

Use the style. removeProperty() method to remove CSS style properties from an element, e.g. box. style. removeProperty('background-color') .


1 Answers

You can check it at the w3c documentation here. As it says, the initial value is none.

like image 142
scumah Avatar answered Nov 15 '22 20:11

scumah