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; ...

Get Sams Teach Yourself CSS in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.