13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

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.

All caps<br />

I am quite pleased with my drop cap. However, it is a bit visually jarring to have my paragraph go from such a bombastic<br />

introduction directly into much smaller lowercase text. I’ll address this issue with one last bit of refinement, after which<br />

#main will be ready to meet its public.<br />

If you haven’t learned it in the typesetting world, you have probably learned it in the online world, especially in e-mail and<br />

instant messages: text set in all capital letters should be used with great caution. An errant mash of the Caps Lock key can<br />

give your audience members the impression that you are YELLING AT THEM, which isn’t the best way to keep them coming<br />

back. With this rule in mind, all caps can still be used to great effect, and a restrained usage will make a logical bridge<br />

between my gigantic drop cap and the much smaller body text that it introduces. Since my date stamp—October 7, 1849<br />

(the date of Poe’s death)—already functions as a concise, self-contained opening to the text, it is a perfect candidate for the<br />

all caps treatment.<br />

Your first instinct might be to merely set the text in all caps right in the markup, thereby avoiding the decidedly more laborious<br />

CSS process I am about to describe. This isn’t a good idea for a number of reasons, and chief among them is the<br />

possibility that you may later wish to style this text differently. If this were a template from which many pages were built, it<br />

would be a lot easier to change one rule in a CSS file than to change the markup in dozens (or hundreds or thousands) of<br />

HTML documents. Also, as you’ll see in the following example, there can be quite a bit more to consider while setting all<br />

caps text than merely typing with Caps Lock on.<br />

I’ll begin by adding one last span to my markup to target the date stamp:<br />

<br />

October 7, 1849: Lorem ipsum...<br />

Now I just need two simple, self-explanatory CSS rules to make my datestamp class behave in the desired fashion:<br />

.datestamp {<br />

text-transform: uppercase;<br />

letter-spacing: .13em;<br />

}<br />

Giving text-transform a value of uppercase will ensure that<br />

my text is set in all caps. It can also take the values lowercase<br />

(for all lowercase text) and capitalize (to capitalize the first<br />

letter of each word). As for letter-spacing, when setting text<br />

in all caps, a bit of extra letter spacing is key for legibility.<br />

Through a small amount of experimentation, I came to find the<br />

very precise 0.13em measurement to be ideal for this case<br />

(Figure 7-19).<br />

Figure 7-19. #main’s datestamp set in all caps Georgia<br />

chapter 7 Bridging the Type Divide: Classic Typography with CSS<br />

175

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

Saved successfully!

Ooh no, something went wrong!