13.07.2015 Views

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

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.

Part II: PropertiesHere are a few more possible variations of the font property:font: bold 1.2em Arial, sans-serif;This makes the font bold and 1.2em in size. Then, like the font-family property, the font propertyaccepts a list of fonts. I’ve specified an Arial font, which is common. If that font isn’t found on the user’scomputer, the generic sans-serif font is used. The following is another variation of the font property:font: italic 1.2/2em “Times New Roman”, Times, serif;The preceding rule makes the font italic and 1.2em in size with a 2em line height. Those specificationsare followed by a list of font families.Now that you’ve had an overview of the font shorthand property, you can try out the font property <strong>for</strong>yourself in the following Try It Out.Try It OutApplying the font PropertyExample 6-4. Follow these steps to try out the font property.1. In your text editor, type the following markup:fontThe font shorthand property lets you combine up to sixdifferent properties in one single property.You can make text that’s bold, 24 pixels in size,and sans-serif.You can make text that’s italic, bold, small-caps,24 pixel sans-serif, which looks like a comicbook font.Or you can just keep it simple, 16 pixels andmonospace.198

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

Saved successfully!

Ooh no, something went wrong!