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.

178<br />

When faced with the following set of CSS rules, a web<br />

browser will set the specified text in Georgia Italic, which<br />

is of course a different design from—and not merely a<br />

slanted bastardization of—Georgia Regular.<br />

font-family: Georgia;<br />

font-style: italic;<br />

However, if I were to add a rule of font-variant: smallcaps,<br />

the text couldn’t be set in true small caps because<br />

Georgia has none to offer. Likewise, the vast majority of<br />

the most widely, publicly disseminated digital text faces<br />

do not include a set of small caps. As a result, web<br />

browsers use faux small caps by default. Before the dawn<br />

of screen font-smoothing technologies like Quartz (Mac<br />

OS) and ClearType (Windows), this wasn’t much of an<br />

issue, since the subtleties of faux small caps’ proportional<br />

differences were lost to the pixelated letters’ low resolution<br />

(Figure 7-23). With screen font-smoothing becoming<br />

increasingly prevalent, though, we can no longer rely on<br />

the browser to cover up its own typographic faux pas.<br />

Faux small caps now look more or less the same on the<br />

screen as they do in print.<br />

Figure 7-23. Pixelated small caps (top) vs.<br />

smoothed small caps (bottom)<br />

Though faux small caps have been the object of legitimate<br />

scorn since long before the Web even existed, the<br />

argument could be made that they are acceptable on the<br />

Web, if only because true small caps simply aren’t available<br />

yet. Conspicuous though they may be, they still<br />

certainly have the power to enhance and enrich the page.<br />

The decision of whether or not to use them is yours<br />

to make.<br />

More pseudo-element selectors in an<br />

imperfect world<br />

My last attempt at using a pseudo-element selector<br />

ended in heartache (remember :first-letter?), but, for<br />

the sake of small caps, I’m going to try again, this time<br />

with :first-line. Unsurprisingly, :first-line affects its<br />

targeted element’s first line of text. In this case, the targeted<br />

element will be #about’s first paragraph.<br />

#about p.first:first-line {<br />

font-variant: small-caps;<br />

text-transform: lowercase;<br />

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

}<br />

By now, these CSS rules should be fairly elementary, but<br />

there is one line that may have raised a questioning eyebrow.<br />

Why did I use text-transform: lowercase? The<br />

reasons are both preferential and practical. Small caps<br />

can, by their nature, function as either uppercase or lowercase<br />

letters. Accordingly, words that would ordinarily<br />

require capitalization (such as proper names) may or may<br />

not begin with a full capital letter when set in small caps.<br />

I usually prefer not to capitalize words set in small caps as<br />

a matter of consistency, since acronyms typically use<br />

small caps in place of the full caps that otherwise construct<br />

them. As for the practical concern, I don’t want any<br />

more attention drawn to the artificiality of my faux small<br />

caps than is necessary. To have them sit alongside full<br />

caps invites comparison and further exposes their inauthenticity<br />

(as seen in Figure 7-23), so I prefer to keep<br />

them among their own faux kind if I can.<br />

This may be sound reasoning, but Internet Explorer and<br />

Safari will hear none of it. Each has its own bug that<br />

prevents the intended effect from happening. Internet<br />

Explorer will not acknowledge any combination of<br />

font-variant and text-transform rules, and Safari will<br />

not acknowledge a text-transform rule applied to a<br />

pseudo-element selector. As a result, Internet Explorer<br />

and Safari both render the markup’s capital letters as full<br />

caps. Firefox and Opera display the text correctly.<br />

The Safari bug in particular makes it impossible for my<br />

intended effect to render consistently across browsers, as<br />

it's a combination of the pseudo-element selector firstline<br />

and the text transform rule lowercase that I'm<br />

trying to use here. Therefore, avoiding further changes to<br />

my markup and ensuring that my small caps remain only<br />

on the first line of text will require a compromise: Internet<br />

Explorer and Safari will display a potentially mixed<br />

bag of full caps and faux small caps. Looking at the finished<br />

page (Figure 7-24), I think I could definitely do a lot<br />

worse!

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

Saved successfully!

Ooh no, something went wrong!