Chapter 1. Flexible Text
Few Web design topics are as storied and
While I'm in no position to rid the world of its war on text sizing, in this chapter I share a single strategy for sizing text on the Web that is both flexible and easy to implementand at the same time allows you to maintain as much design control as possible.
The allowance for flexibility in sizing text is one of the keys that drive the rest of the examples in this bookthat by giving the
user
the ability to control the size of text on the page, we're increasing its readability for all the Web's
To understand how best to be flexible when sizing text, let's first look at a common example and why it's not flexible. |
A Common Approach
To
Figure 1.1. To
|
|
|
It's important to point out that we're not scorning the designers of
eyeglasses.com
. In fact, it's a very nicely designed site, built with structured markup and CSS for its designprecisely why I've
|
body {
font-size: 11px;
}
By setting a size (
11px
in this case) for text on the
<body>
element, the designers ensure that the entire page (unless overridden by a
Sizing text with pixels gives the designer control over the size of type, yet poses a problem for users of the most popular Web browser out there (at the time of this writing): Internet Explorer for Windows (IE/Win).
Browsers typically provide the user with a means to control the size of text on the page, overriding the size that is specified by the designer. This is great, and extremely useful for someone who is visually impaired. To increase readability, a user with poor vision can choose a larger font size via a browser menu (Figure 1.2).
Sounds perfect, doesn't it? But there's a catch. Internet Explorer users on Windows won't be able to override the size of text specified by the designer when pixel units are used. So while using pixel units gives the designer the greatest precision in determining font size, it also eliminates the possibility for IE/Win users to adjust that size if they so desire. Ouch. Users of other browsers can safely adjust font size no matter how the fonts are specified.
The ability to adjust text size is
essential
for people with poor vision, and those users who want to increase readability on Web pages that feature small text by default appreciate the option. As designers, it's our nature to want complete control over the appearance of an entire Web page. But in giving up just a
smidgeon
of that control
note
|
|
Technically, a pixel is a
relative
unit of measurement, relative to the resolution of the device that is displaying or printing it. For example, a pixel's actual size
|
As for IE/Win's reluctance to resize text set with pixel units, perhaps the developers stuck to the idea that a pixel is a pixelan infallible unit that should never change, even if users wish to supersede (which they should have every right to do). Regardless, all other browsers got it right, allowing text
Life would be simple if designers could choose to declare a font size in pixels, and users could adjust however they wished, but because of the inability to scale that text in IE/Win, that's not optimal. So let's explore alternate