You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2-ui/1-document/08-styles-and-classes/article.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,7 @@ Sometimes we want to assign a style property, and later remove it.
116
116
117
117
For instance, to hide an element, we can set `elem.style.display = "none"`.
118
118
119
-
Then later we may want to remove the `style.display` as if it were not set. Instead of `delete elem.style.display` we should assign an empty line to it: `elem.style.display = ""`.
119
+
Then later we may want to remove the `style.display` as if it were not set. Instead of `delete elem.style.display` we should assign an empty string to it: `elem.style.display = ""`.
120
120
121
121
```js run
122
122
// if we run this code, the <body> "blinks"
@@ -207,7 +207,7 @@ For instance, here `style` doesn't see the margin:
207
207
</body>
208
208
```
209
209
210
-
...But what if we need, say, to increase the margin by 20px? We want the current value for the start.
210
+
...But what if we need, say, to increase the margin by 20px? We would want the current value of it.
211
211
212
212
There's another method for that: `getComputedStyle`.
213
213
@@ -281,7 +281,7 @@ Visited links may be colored using `:visited` CSS pseudoclass.
281
281
282
282
But `getComputedStyle` does not give access to that color, because otherwise an arbitrary page could find out whether the user visited a link by creating it on the page and checking the styles.
283
283
284
-
JavaScript we may not see the styles applied by `:visited`. And also, there's a limitation in CSS that forbids to apply geometry-changing styles in `:visited`. That's to guarantee that there's no sideway for an evil page to test if a link was visited and hence to break the privacy.
284
+
JavaScript may not see the styles applied by `:visited`. And also, there's a limitation in CSS that forbids to apply geometry-changing styles in `:visited`. That's to guarantee that there's no sideway for an evil page to test if a link was visited and hence to break the privacy.
0 commit comments