Style Sheets
  Home arrow Style Sheets arrow Using Empty Span Tags with H2 Headers for ...
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

Using Empty Span Tags with H2 Headers for Image Replacement
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-12-08

    Table of Contents:
  • Using Empty Span Tags with H2 Headers for Image Replacement
  • Review: the enhanced Fahrner's IR technique
  • Styling H2 elements with Fahrner's enhanced IR method
  • Putting it all together on one web page

  • 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


    Using Empty Span Tags with H2 Headers for Image Replacement


    (Page 1 of 4 )

    In this eighth installment of a series on image replacement techniques, you'll learn how to use Fahrner’s enhanced image replacement method for styling all of the H2 elements included in a sample web document. This method uses two empty <span> tags in a clever way which permits you to efficiently solve the problem caused by broken background images.

    True to form, one of the most appealing facets of CSS-based image replacement (IR) is its remarkably flat learning curve. Many of the methods created for this purpose in the past few years can be mastered by those with only an intermediate background in style sheets and (X)HTML.

    Therefore, if you’re a web designer who wants to start digging deeper in the always-exciting terrain of image replacement, then in this group of articles you’ll find a comprehensive guide that will show you how to implement the most efficient IR approaches available today. You can use them to give your web pages a fresh look without messing up their structural markup.

    Naturally, if you’ve already read all of the tutorials that precede this one, then it’s probable that you understand the IR methods developed by Mike Rundle and Todd Fahrner respectively. In those articles I demonstrated how to implement the methods via a decent variety of code samples, first decorating H1 and H2 headers and then styling some basic <a> elements.

    However, it’s fair to mention here that the original Fahrner’s approach has been considerably improved over time. Currently it allows you not only to add eye-catching background images to different text-based web page elements, but helps you to keep those elements visible even if the pertinent images fail to download.

    In the last part of the series I showed how to use this enhanced IR method only with a single H1 header, but as you may have guessed, it’s possible to apply it to other HTML elements with the same ease. Thus, in the next few lines I’ll be discussing how to use Fahrner’s improved technique with multiple H2 headers, a process that hopefully will be educational and, why not, also fun.

    Ready to learn more useful things about this handy image replacement method? Then start reading now!

    More Style Sheets Articles
    More By Alejandro Gervasio


       · This installment the series discusses how to use Fahrner’s enhanced image...
     

    STYLE SHEETS ARTICLES

    - Styling Pseudo Classes with the RGBA CSS3 Pr...
    - Controlling Overall Transparency of an HTML ...
    - Altering the Border Opacity of an HTML Eleme...
    - The RGBA CSS3 Property: an Overview
    - Using Span Tags to Include Logos in Web Pages
    - Using a Single H1 Element to Include Logos i...
    - Combining Divs and H1 Elements to Include Lo...
    - Semantically Including Logos in Web Pages
    - Adding Text Indentation to Style Code Blocks...
    - Decorating Line Numbers in Code Blocks Style...
    - Changing the Color of Code Lines with CSS
    - Using Ordered Lists to Style Code Blocks wit...
    - Using a Zebra Background Effect to Style Cod...
    - Displaying Rounded Corners Built with CSS3 i...
    - Building Rounded Corners with CSS3`s -webkit...







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