Skip to content
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
4 changes: 2 additions & 2 deletions 2-ui/1-document/08-styles-and-classes/article.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Styles and classes

Before we get to JavaScript ways of dealing with styles and classes -- here's an important rule. Hopefully it's obvious enough, but we still have to mention it.
Before we get into JavaScript's ways of dealing with styles and classes -- here's an important rule. Hopefully it's obvious enough, but we still have to mention it.

There are generally two ways to style an element:

Expand Down Expand Up @@ -147,7 +147,7 @@ To set the full style as a string, there's a special property `style.cssText`:
</script>
```

We rarely use it, because such assignment removes all existing styles: it does not add, but replaces them. May occasionally delete something needed. But still can be done for new elements when we know we don't delete something important.
We rarely use it, because such assignment removes all existing styles: it does not add, but replaces them. May occasionally delete something needed. But still can be done for new elements when we know we won't delete something important.

The same can be accomplished by setting an attribute: `div.setAttribute('style', 'color: red...')`.
````
Expand Down