10.04.2018 Views

design3

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

126<br />

The Principles of Beautiful Web Design<br />

to consider text image replacement. Note that this doesn't mean just tossing an tag with your<br />

text straight into your HTML. Using an image tag to display text is neither accessible nor search<br />

engine friendly—because any visitors who’re unable to see the image will be left in the dark. This<br />

includes search engine spiders, of course.<br />

Instead, you’ll want to mark up your text as actual text. Take the example of the Barstow website 9 ,<br />

shown in Figure 4.4. It features rounded vintage text, which looks great and stands out against all<br />

of the straight and grid-based typography on the web. If I wanted to make the logo and text accessible,<br />

I would make it an HTML element and give it a class of logo-active.<br />

To replace that with an image, I’d then use CSS to set the width and height of the link to the size<br />

of my image, and set the display property to block, since links are inline by default. Then, I typically<br />

use what’s known as the Phark Method of image replacement. This involves setting my image as<br />

the background of the element, and then adding a negative text-indent value high enough to move<br />

my text content out of the block (and off the screen!). The CSS would look like this:<br />

.logo-active {<br />

display:block;<br />

width:300px;<br />

height:150px;<br />

background:url(/images/clowns.png);<br />

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

}<br />

Figure 4.4. The Barstow website<br />

9 http://www.ridebarstow.com/

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

Saved successfully!

Ooh no, something went wrong!