Click here to return to our portfolio

You know that one browser that has only a vague association with modern web standards? Yeah, Internet Explorer. Wouldn't it be great if it supported stuff like translucent PNGs? Well, now you can add decent PNG support to IE5.5+ on Windows with no changes to your website HTML source code.

The script we're featuring in today's column, created by Angus Trumbull from TwinHelix, will add near-native PNG support with full alpha opacity, with only one line in your CSS file, that applies to all <img> tags and also background images!

The way this solution works is a bit different from the other fixes you'll find here and there, because you don't have to insert any <script> tag into your HTML pages. All is done at the CSS level, using CSS behaviors, a custom Microsoft extension to CSS.

Of course, as such, it will not affect any other browsers like Mozilla and Opera which already implement good PNG support. It will also not help IE4.0 and IE5.0, which don't include the necessary IE filter, and does nothing with IE5/Mac (which natively supports translucent PNG foreground images, however).

Getting the snippet to work requires four easy steps:

  • Download the tiny module (iepngfix.htc) from TwinHelix' website
  • Upload the snippet and a blank .GIF image to your server
  • Into the snippet code, edit the blankImg variable so it points to the blank .GIF
  • insert the following rule into your main stylesheet:

img { behavior: url(iepngfix.htc); }

However, there are certain limitations:

  • Can't help IE versions prior to 5.5, sorry.
  • Users can't right-click-save processed PNG images, they'll save the blank GIF file if they try that. In some cases this might be a feature, not a bug...
  • The script detects the ".png" extension in image URLs. So if you have a CGI script that generates a PNG image, you may have to rewrite parts of the script, or just cache them as PNG files somewhere.
  • It's most reliable on elements with non-'auto' dimensions set. So, give images and other elements width/height values; '100%', '10em' and '200px' and so on are all OK.
  • Background PNG images can't be tiled. This is a limitation of the IE filter.
  • Similarly, padding and borders don't indent the PNG image. An easy fix for this is wrapping your PNG images in container DIVs or similar.
  • There may be about a short time as soon as the image loads when images are not transparent, before the IE filter kicks in.

Enough talk, time to get it!

» Download IE PNG Alpha Fix v1.0

Getting sites built and running in very short delays is a daily constrain every webdesigner has to deal with. In order to save time and money, why not rely on existing templates that can be adapted to suit the client's needs ? Furthermore, reusing free CSS templates also ensures (most of the time) that the reused code will be 100% XHTML/CSS compliant.

Below, you'll find 30 online repositories from where you can download CSS-based templates for free, and that can be used in your personal and commercial projects without any restrictions whatsoever.

» Free CSS Templates
» Art for the web
» TemplatesBox
» Template Monster
» TemplateNavigator
» CoffeeCup
» DotcomWebDesign
» Effex-Media
» Entheos
» Dezinehub
» Free-Flash-Template
» Free Layouts
» Free Photoshop browser templates
» 20 Free CSS Templates
» Free Templates Online
» Free Web Templates
» FreeWebTemplates.de
» FreeWebsiteTemplates.com
» Groovy Lizard
» Hot Free Templates
» Interspire
» Joyful Heart Designs
» Layouts 4 Free
» MasterTemplates
» OpenSourceTemplates.org
» Open Source Web Design
» Open Web Design
» Painted Pixels
» Ricky’s web templates
» Steve’s free website templates
» Template Perfection
» TemplateWorkz
» ThemesBase
» Webmaster Resources
» Zymic

Web development is a strange animal: it grows faster than anything else, obliging designers and developers to keep themselves constantly up-to-date, much more than in other field. Stay a couple of months without reading about new tools and tehcniques, and you're history. At The Art Company, we keep an eye on the recent developments and collect new ideas and methods for our readers. We've choosen for you 20 CSS techniques, tips and tricks that you may find handy.

Generic techniques

» Rounded corners with images and without images
» Super Simple CSS barcharts
» CSS flowchart-style diagrams
» CSS-based navigation: menus and tabs
» CSS Menu maker
» CSS design: going to print with CSS
» Positioning a footer with CSS
» CSS Panic: a guide for the unglued

Image and popups

» Hoverbox image gallery
» Pure CSS popups
» CSS Map Pop: CSS image maps without javascript

Forms with style

» A CSS Stylesheet Collection for Web Forms
» Prettier accessible forms
» Styling even more form controls
» Tableless forms
» Rediscovering the <button> element
» CSS star rating redux

Layout and galleries

» Iron Myers' CSS Layouts
» IntensivStation's Templates
» CSS Zen Garden

© 2008 The Art Company – All rights reserved.
"The Art Company" brand and logo are the property of The Art Company.
All other brands and names are the property of their respective owners.
XHTML - CSS