Lesson 3: Formatting Text with CSS


In this lesson, you’ll learn how to control the appearance of text on your web pages using CSS styling.

What you’ll learn in this lesson:

  • Using the font-family property
  • Setting text size
  • Working with the em measurement
  • Changing text properties
  • Using HTML lists

Starting up

You will work with several files from the HTML5_03lessons folder in this lesson. Make sure you have loaded the HTML5lessons folder onto your hard drive from www.digitalclassroombooks.com/HTML5. See “Loading lesson files” in the Starting Up section of this book.

3409.jpg Although this lesson uses the TextWrangler text editor to create the markup, you can use any text editor and get the same results.

The importance of typography on the Web

Typography is two-dimensional architecture, based on experience and imagination, and guided by rules and readability. And this is the purpose of typography: The arrangement of design elements within a given structure should allow the reader to easily focus on the message, without slowing down the speed of his reading.

—Hermann Zapf

Typography has a starring role in graphic design, including web design. Most user interaction on the Web starts with text. Users spend a great deal of time on the web scanning, navigating, and reading text. As a ...

Get HTML5 Digital Classroom now with O’Reilly online learning.

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