Do you avoid using "inherit" value of style.display?

Updated by Brady Stroud [SSW] 1 year ago. See history

123

The property value “inherit” of style.display is not recognized by IE7 and IE7 compatibility mode. So if you use this value in Javascript, it will cause script error in IE7 and IE7 compatibility like: "Message: Could not get the display property. Invalid argument."

So to make your Javascript and CSS style more compatible and avoid using "inherit" value of style.display:

divLoading.style.display = "inherit";

❌ Figure: Bad code - inherit property.

divLoading.style.display = "block";

✅ Figure: Good code - block property.

acknowledgements
related rules