Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Rule “do-you-avoid-using-inherit-value-of-style-display/rule” #7190

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions rules/do-you-avoid-using-inherit-value-of-style-display/rule.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
---
type: rule
archivedreason: IE7 is no longer supported
title: Do you avoid using "inherit" value of style.display?
guid: a99dd941-f70a-4aa6-8526-fd2ee1b547c7
uri: do-you-avoid-using-inherit-value-of-style-display
created: 2010-12-02T10:35:22.0000000Z
authors: []
related: []
redirects:
- do-you-avoid-using-"inherit"-value-of-style-display

- do-you-avoid-using-"inherit"-value-of-style-display
created: 2010-12-02T10:35:22.000Z
archivedreason: IE7 is no longer supported
guid: a99dd941-f70a-4aa6-8526-fd2ee1b547c7
---
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."

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:
<!--endintro-->

<!--endintro-->

```
```js
divLoading.style.display = "inherit";
```

Bad code - inherit property
::: bad
Bad code - inherit property.
:::

```
```js
divLoading.style.display = "block";
```

Good code - block property
::: good
Good code - block property.
:::
Loading