Style Sheets
  Home arrow Style Sheets arrow Image Replacement CSS Techniques
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

Image Replacement CSS Techniques
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-11-20

    Table of Contents:
  • Image Replacement CSS Techniques
  • Basic web page for image replacement
  • Using image replacement to style an H1 element
  • The image replacement method in action

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Image Replacement CSS Techniques


    (Page 1 of 4 )

    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.

    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!

    More Style Sheets Articles
    More By Alejandro Gervasio


       · There’s a few image replacement methods used nowadays that rely heavily on CSS to do...
     

    STYLE SHEETS ARTICLES

    - Using the Custom -moz-border-radius Property...
    - Using CSS3`s Border-Radius Property to Build...
    - Adding Semantic Meaning to Styled Code Block...
    - Styling Code blocks with CSS: Using pre HTML...
    - Building Rounded Corners with CSS3
    - Finishing a Casual Navigation Bar with CSS S...
    - Defining a Navigation Bar`s Hover State with...
    - Styling a Blog`s Links Bar with CSS Sprites
    - Creating an Artistic Blog Header with CSS Sp...
    - Defining the Active State of Menu Sections f...
    - Styling the Hover State of a CSS Sprite-Base...
    - Building CSS Sprite-Based Navigation Bars
    - Creating Framed Pictures with CSS
    - Using a CSS Shading Effect to Decorate Images
    - Decorating Images with CSS







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek