Chapter 9. CSS-DOM

What this chapter covers:

  • Introducing the style property

  • How to retrieve style information

  • How to change styles

In this chapter, the presentation layer and the behavior layer will meet head-on. You'll see how the DOM can be used to get and set styles by reading and writing CSS.

Three sheets to the Web

Content on the Web can be wrapped up in three successive layers that web browsers can read:

  • Structure

  • Presentation

  • Behavior

Structure

First and foremost, the structural layer is created with a markup language, such as HTML or XHTML. The tags, or words contained in angle brackets, describe the semantic meaning of content. For example, the <p> tag conveys the information, "This content is a paragraph." But the tag doesn't include any information ...

Get DOM Scripting: Web Design with JavaScript and the Document Object Model, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.