04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

common text properties<br />

Text and fonts from 30,000 feet<br />

A lot of the <strong>CSS</strong> properties are dedicated to helping you style your text. Using<br />

<strong>CSS</strong>, you can control typeface, style, color, and even the decorations that are<br />

put on your text, and we’re going to cover all these in this chapter. We’ll start<br />

by exploring the actual fonts that are used to display your pages. You’ve already<br />

seen the font-family property and in this chapter you’re going to learn a lot<br />

more about specifying fonts.<br />

Before we dive in, let’s get the 30,000 foot view of some properties you can use<br />

to specify and change the look of your fonts. After that, we’ll take the fonts one<br />

by one and learn the ins and outs of using each.<br />

Customize the fonts in your pages <strong>with</strong> the font-family property.<br />

Fonts can have a dramatic effect on your page designs. In <strong>CSS</strong>, fonts are<br />

divided into “font families” from which you can specify the fonts you’d<br />

like used in each element of your page. Only certain fonts are commonly<br />

installed on most computers, so you need to be careful in your font<br />

choices. In this chapter we’ll take you through everything you need to<br />

know to specify and make the best use of fonts.<br />

body {<br />

font-family: Verdana, Geneva, Arial, sans-serif;<br />

}<br />

Control the size of your fonts <strong>with</strong> the font-size property.<br />

Font size also has a big impact on the design and the readability of your<br />

Web pages. There are several ways to specify font sizes <strong>with</strong> <strong>CSS</strong>, and in<br />

this chapter we’ll cover each one, but we’ll also teach you how to specify<br />

your fonts in a way that allows your users to increase the font size <strong>with</strong>out<br />

affecting your designs.<br />

body {<br />

font-size: 14px;<br />

}<br />

342 Chapter 9<br />

Andale Mono<br />

Arial<br />

Arial Black<br />

Comic Sans<br />

Courier New<br />

Georgia<br />

Impact<br />

Times New Roman<br />

Trebuchet MS<br />

Verdana<br />

body is 14px<br />

h1 is 21px p is 14px h2 is 17px

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!