Cover by Marijn Haverbeke

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

Style Sheets

Closely tied to HTML and the DOM is the topic of style sheets. It is a big topic, and I will not discuss it entirely, but some understanding of style sheets is necessary for a lot of interesting JavaScript techniques.

In old-fashioned HTML, the only way to change the appearance of elements in a document was to give them extra attributes or to wrap them in extra tags, such as center to center them horizontally or font to change the font style or color. This meant that if you wanted the paragraphs or the headers in your document to look a certain way, you had to add a bunch of attributes and tags to every single one of them. This quickly adds a lot of noise to such documents and makes them annoying to write or to change.

Well, people ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required