Chapter 21. Cascading Style Sheets and CGI Programming

Cascading Style Sheets and CGI Programming

In this chapter, I’ll take a look at working with Cascading Style Sheets (CSS). CSS and JavaScript connect well because styles are dynamic these days, which means you can change them on-the-fly, as we’ll see in this chapter.

You set styles using style attributes—for example, here’s how I use the color style attribute to set the text color in a document to coral:

<BODY STYLE="color: coral"> 

The exciting thing is that you can access style properties from JavaScript. We’ve already seen this at work to some extent. For example, here’s Listing 16-01.html, which turns the color of text ...

Get Inside JavaScript now with O’Reilly online learning.

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