Skip to content

Commit 384a7b7

Browse files
authored
Update article.md
1 parent 4b02949 commit 384a7b7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

2-ui/1-document/08-styles-and-classes/article.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For other cases, like making the text red, adding a background icon -- describe
2626

2727
## className and classList
2828

29-
Changing a class is one of the most often actions in scripts.
29+
Changing a class is one of the most often used actions in scripts.
3030

3131
In the ancient time, there was a limitation in JavaScript: a reserved word like `"class"` could not be an object property. That limitation does not exist now, but at that time it was impossible to have a `"class"` property, like `elem.class`.
3232

@@ -76,7 +76,7 @@ Besides that, `classList` is iterable, so we can list all classes like this:
7676
```html run
7777
<body class="main page">
7878
<script>
79-
for(let name of document.body.classList) {
79+
for (let name of document.body.classList) {
8080
alert(name); // main, and then page
8181
}
8282
</script>
@@ -223,7 +223,7 @@ element
223223
: Element to read the value for.
224224
225225
pseudo
226-
: A pseudo-element if required, for instance `::before`. An empty string or no argument mean the element itself.
226+
: A pseudo-element if required, for instance `::before`. An empty string or no argument means the element itself.
227227
228228
The result is an object with style properties, like `elem.style`, but now with respect to all CSS classes.
229229
@@ -250,10 +250,10 @@ For instance:
250250
```smart header="Computed and resolved values"
251251
There are two concepts in [CSS](https://drafts.csswg.org/cssom/#resolved-values):
252252
253-
1. A *computed* style value is the value after all CSS rules and CSS inheritance is applied, as the result of the CSS cascade. If can look like `height:1em` or `font-size:125%`.
253+
1. A *computed* style value is the value after all CSS rules and CSS inheritance is applied, as the result of the CSS cascade. It can look like `height:1em` or `font-size:125%`.
254254
2. A *resolved* style value is the one finally applied to the element. Values like `1em` or `125%` are relative. The browser takes the computed value and makes all units fixed and absolute, for instance: `height:20px` or `font-size:16px`. For geometry properties resolved values may have a floating point, like `width:50.5px`.
255255
256-
Long time ago `getComputedStyle` was created to get computed values, but it turned out that resolved values are much more convenient, and the standard changed.
256+
A long time ago `getComputedStyle` was created to get computed values, but it turned out that resolved values are much more convenient, and the standard changed.
257257
258258
So nowadays `getComputedStyle` actually returns the resolved value of the property.
259259
```
@@ -283,7 +283,7 @@ Visited links may be colored using `:visited` CSS pseudoclass.
283283
284284
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.
285285
286-
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 side way for an evil page to test if a link was visited and hence to break the privacy.
286+
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.
287287
```
288288

289289
## Summary

0 commit comments

Comments
 (0)