O'Reilly logo

The Definitive Guide to HTML5 by Adam Freeman

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

C H A P T E R  29

Styling DOM Elements

As you will recall from Chapter 4, you can apply styles to an element indirectly (through a stylesheet or the style element) or directly (through the style attribute). In this chapter, I show how you can use the DOM to work with the CSS styles in your document—both the ones you have explicitly defined, as well as the computed style that the browser uses to actually display elements. The specification for working with CSS in the DOM contains some deep hierarchies of object types, many of which are not implemented by the browsers. I have simplified the objects in this chapter to focus on those that the browsers use. Table 29-1 provides the summary for this chapter. Please note that not all of the examples ...

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