Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

CHAPTER 12 FORMATTING TEXT > The Font Properties - Pg. 204

The Font Properties AT A g l A n C e The Font Properties When I design a text document (especially for print, but also for the Web), one of the first things I do is specify the font. In CSS, fonts are specified using a little bundle of font-related properties for typeface, size, weight, and font style. There is also a shortcut property that lets you specify all of the font attributes in one fell swoop. The nature of the Web makes specifying type tricky, if not downright frustrating, particularly if you have experience designing for print (or even formatting text in a word processing program). Because you have no way of knowing which fonts are loaded on users' machines, you can't be sure that everyone will see text in the font you've chosen. And because the default font size varies by browser and user preferences, you can't be sure how large or small the type will appear, as well. We'll address the best practices for dealing with these font challenges as we go along. The font-related properties: y font-family y font-size y font-weight y font-style y font-variant y font A Word About Property Listings Each new property listing in this book is accompanied by information on how it behaves and how to use it. Here is a quick explanation of each part of property listings. Values Specifying the font name Choosing a typeface, or font family as it is called in CSS, is a good place to start. Let's begin with the easy part: using the property font-family and its values.