Style Sheets
  Home arrow Style Sheets arrow Page 3 - Creating Gradients for Web Page Headers wi...
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 
Sun Developer Network 
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

Creating Gradients for Web Page Headers with PNG Images
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-05-28

    Table of Contents:
  • Creating Gradients for Web Page Headers with PNG Images
  • Reintroducing the AlphaImageLoader Microsoft’s proprietary filter
  • Decorating headers of a web page
  • Linking the gradient CSS class to the structural markup

  • 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


    Creating Gradients for Web Page Headers with PNG Images - Decorating headers of a web page


    (Page 3 of 4 )

    If you found it extremely easy to decorate the background of a web page using a PNG-based gradient, then you’ll probably grasp how to apply the same visual effect to some of its section headers. Basically, the procedure is quite straightforward, and it requires defining a generic “sectionheader” CSS class that can be quickly linked to all of the headers of a sample web page.

    So, having explained how this approach is going to function, pay attention to the definition of the aforementioned “sectionheader” CSS class. It’s as follows:


    .sectionheader{

    background: #fff url(bg.png) left top repeat-x;

    }

    /* use the * html CSS hack to render an alpha-based transparent background */

    * html . .sectionheader {

    background: #fff;

    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='bg.png',
    sizingMethod='scale');

    }


    As you can see, the above “.sectionheader” CSS class has been defined in such a way that it will be applied normally to selected elements of a web page when working with non-IE browsers. However, in Internet Explorer, the corresponding “AlphaImageLoader” filter will be used instead.

    This CSS hack will make all of the gradients that use a transparent PNG image display correctly on most browsers. As you’ll certainly recall, this simple hack was used when building complete web page gradients. Its flexibility allows it to be applied, for instance, to all the <h2> headers of a sample web page.

    The demonstration of how to decorate all of the <h2> headers with PNG-based gradients will be explained in detail in the last section of this tutorial. Therefore, click on the link shown below and keep reading, please.

    More Style Sheets Articles
    More By Alejandro Gervasio


       · In the previous article, you learned how to implement a cross-browser approach for...
     

    STYLE SHEETS ARTICLES

    - Improving the Visual Presentation of a CSS D...
    - Fixing Browser Incompatibilities in a CSS Dr...
    - Building Clean Drop-Down Menus with CSS
    - Creating Hybrid Web Page Layouts with Negati...
    - Creating Three-Column Web Page Layous with N...
    - Swapping Column Positions in Web Page Layout...
    - Creating Web Page Layouts with Negative Marg...
    - Creating Gradients for Individual Containers...
    - Creating Gradients for Web Page Headers with...
    - SEO Scrolling Frames Problem Solved
    - Building Cross-Browser Background Effects wi...
    - CSS: Pseudo
    - Using PNG Images to Build Background Effects
    - CSS: Continuing the Clarification of CSS Cla...
    - CSS: Top Secret Classification






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT