Skip to Main Content
Cascading Style Sheets: The Definitive Guide, Second Edition
book

Cascading Style Sheets: The Definitive Guide, Second Edition

by Eric A. Meyer
March 2004
Intermediate to advanced content levelIntermediate to advanced
528 pages
16h 33m
English
O'Reilly Media, Inc.
Content preview from Cascading Style Sheets: The Definitive Guide, Second Edition

Stretching and Adjusting Fonts

There are two font properties that appear in CSS2, but not in CSS2.1. They’ve been dropped from CSS2.1 because, despite being in the specification for years, no browser has bothered to implement either one. The first allows for the horizontal stretching of fonts, and the second allows for intelligent scaling of substituted fonts when the author’s first choice is not available. First, let’s look at stretching.

As you might expect from the value names, this property is used to make a font’s characters fatter or skinnier. It behaves very much like the absolute-size keywords (e.g., xx-large) for the font-size property, with a range of absolute values and two values that let the author alter a font’s stretching up or down. For example, an author might decide to stress the text in a strongly emphasized element by stretching the font characters to be wider than their parent element’s font characters, as shown in Figure 5-21:

strong {font-stretch: wider;}
Stretching font characters

Figure 5-21. Stretching font characters

Tip

Figure 5-21 was altered using Photoshop, since web browsers do not support font-stretch as of this writing.

The similarly unimplemented ...

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.
Start your free trial

You might also like

Cascading Style Sheets: The Definitive Guide

Cascading Style Sheets: The Definitive Guide

Eric A. Meyer

Publisher Resources

ISBN: 0596005253Catalog PageErrata