Home arrow Style Sheets arrow Image Replacement CSS Techniques
STYLE SHEETS

Image Replacement CSS Techniques


Image replacement is a useful approach for solving certain web design problems. In this first article of a series that examines this technique, we take a closer look at an image replacement approach that relies on assigning a large negative value to the “text-indent” CSS property to hide the text wrapped by a web page element, thus unmasking its background image.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
November 20, 2009
TABLE OF CONTENTS:
  1. · Image Replacement CSS Techniques
  2. · Basic web page for image replacement
  3. · Using image replacement to style an H1 element
  4. · The image replacement method in action

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Image Replacement CSS Techniques
(Page 1 of 4 )

This is not breaking news, but one of the most frustrating issues that web designers have had to face is the limited number of fonts they can use on a web site, which must be rendered consistently across different browsers. The problem has been the subject of heated debates, and remains surrounded by a halo of controversy.

Leaving behind the troubled waters of the topic, which by the way are out of the scope of this article, web designers have needed to find a solution that allows them to use their preferred fonts without having to rely on the always- uncontrolled terrain of browser settings. And they did it, quite successfully. As you may know, in the last few years different image replacement approaches (IR) have emerged, and today are used widely (although not always wisely) on thousands of websites and web applications.

For the normal designer, IR is nothing but a technique that uses CSS to hide text wrapped by different web page elements, such as headers, links and so forth, with an image. This is it. The beauty of using these IR techniques is that they allow you to win a battle on two fronts: on one hand, target elements will preserve their semantic meaning within the web page’s markup, while on the other, a variety of fonts can be used independently of the browser configuration, as they’re embedded into the image in question.

These benefits, though, come at a cost. The major drawback of IR is less accessibility, particularly for those who use screen readers. Despite this trade-off, which should always be evaluated consciously, IR techniques do deserve a closer look. In the lines to come I’m going to discuss the most relevant ones, so you can choose the one that best suits your needs and preferences.

Now, it’s time to get rid of the preliminaries and start exploring the real power behind using CSS-based image replacement. Let’s get going!


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions
- Create a Simple Transitioning Link Bar with ...

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 11 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials