Coloring Text
This is the easy part! Text color uses the color: property, which, as you can see, does not have a font or text prefix.
To apply a color to a font, simply use the color property along with an appropriate color value. You can refer to Chapter 8, “Working with Color and Images Using CSS,” where I applied the color property in numerous cases and discussed color values at length.
I want to color up the text a bit, so I'm going to apply color to my existing styles (see Example 9-4).
Example 9-4. Coloring the text
body {font-family: Georgia, Times, serif; font-size: 1em; font-weight: normal; color: black;}h1, h2 {font-family: Arial, Helvetica, sans-serif;}h1 {font-size: 150%; font-weight: bold; color: #999;}h2 {font-size: 130%; font-weight: lighter; font-style: italic; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access