Cover by Eric Freeman, Elisabeth Robson

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Chapter 8. Styling with Fonts and Colors: Expanding Your Vocabulary

image with no caption

Your CSS language lessons are coming along nicely. You already have the basics of CSS down, and you know how to create CSS rules to select and specify the style of an element. Now it’s time to build your vocabulary, and that means picking up some new properties and learning what they can do for you. In this chapter we’re going to work through some of the most common properties that affect the display of text. To do that, you’ll need to learn a few things about fonts and color. You’re going to see you don’t have to be stuck with the fonts everyone else uses, or the clunky sizes and styles the browser uses as the defaults for paragraphs and headings. You’re also going to see there is a lot more to color than meets the eye.

Text and fonts from 30,000 feet

image with no caption

A lot of CSS properties are dedicated to helping you style your text. Using CSS, you can control font, style, color, and even the decorations that are put on your text, and we’re going to cover all these in this chapter. We’ll start by exploring the actual fonts that are used to display your pages. You’ve already seen the font-family property, and in this chapter you’re going to learn a lot more about specifying fonts.

Before we dive in, let’s get the 30,000-foot view of ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required