O'Reilly logo

JavaScript Step by Step by Steve Suehring

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

Chapter 16. JavaScript and CSS

After completing this chapter, you will be able to

  • Understand the basics of Cascading Style Sheets (CSS).

  • Understand the relationship between JavaScript and CSS.

  • Use JavaScript to change the style of an individual element.

  • Use JavaScript to change the style of a group of elements.

  • Use JavaScript to provide visual feedback on a web form using CSS.

What is CSS?

Using CSS, you can specify the look and feel of a webpage: you can apply color, fonts, and layout to the elements of a page.

Figure 16-1 shows a basic webpage. It’s fairly boring—or at least the layout is.

A basic webpage with no styles applied.
Figure 16-1. A basic webpage with no styles applied.

By using CSS, ...

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