O'Reilly logo

Sams Teach Yourself CSS in 10 Minutes by Russ Weakley

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 4. Applying Styles

In this lesson, you will learn the three different locations where you can place CSS code, including inline, header, and external style sheets. You will also learn how to target a style sheet to a specific device such as a cell phone, television, or PDA by using media types. You will also learn methods that can be used to hide advanced styles from older browsers using media types.

Setting Up the HTML Code

The HTML code for this lesson that contains a single paragraph of text is shown in Listing 4.1.

Example 4.1. HTML Code Containing the Markup for Lesson 4

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; ...

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