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.

Image replacement<br />

But I’m still not happy. As much as I love Georgia, that big Georgia O is still not quite doing it for me. This page deserves<br />

something a bit more decorative, so I’ve created my own ornate capital O (Figure 7-16). This O is loosely based on the one<br />

found in Bodoni, an exquisite modern serif designed a year before Poe was born.<br />

Figure 7-16. My custom versal<br />

Rather than putting my versal image in the markup, I’m going to use an image replacement technique.<br />

The particular image replacement technique I used is but one of many, most of which have been compiled by<br />

Dave Shea on his mezzoblue.com site (www.mezzoblue.com/tests/revised-image-replacement/). While I<br />

prefer this method for this example, others may be more appropriate for different situations, and I recommend<br />

reading up on them. You can also find more about image replacement techniques in Chapter 2,<br />

“Taming a Wild CMS with CSS, Flash, and JavaScript.”<br />

Image replacement does exactly what it says: it replaces an element’s HTML text with an image. In this example, it will be<br />

accomplished by sucking the text out of the element with a negative text-indent, and then dropping in my versal graphic<br />

as a background image.<br />

.drop {<br />

width: 83px;<br />

height: 83px;<br />

float: left;<br />

text-indent: -9999px;<br />

background-image: url(o.gif);<br />

background-repeat: no-repeat;<br />

background-position: top left;<br />

margin-right: .1em;<br />

margin-bottom: .1em;<br />

}<br />

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

173

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

Saved successfully!

Ooh no, something went wrong!