Welcome to the Personal Website of George Michael Huff
A PNG IE Nuisance
By George Huff
Ever since I was pushed to figure out the IE PNG filter hack in CSS it has become essential to my website building. Although it does allow a lot more flexibillity when designing and building websites, it has its quirks.
Slowly I have been feeling out the parameters of the png hack. There have been about three times where I must have spent between 3-5 hours trying to figure out why either it wasn’t working, or it was causing other weird issues. Namely the linking issue. There is a thorough guide here, a lot more thorough than anything I would write on the subject. I’m just here to complain, oh and my own solution is listed as well.
It seems if you are using the scale mode within the filter, and the element with the png is positioned relative, then the links within that element cannot be clicked on or rolled over within IE. Where does this leave us? Frusterated, disappointed, thinking of tables (scratch that), hating microsoft, etc…
Currently I am coding a layout that is incredibly complex. It has tons of relative positioning, pngs, and css columns. The challenge is to get it all working cross browser, as well as make it all valid.
There were three main problem areas, but the most difficult one proved to be my right column. Here’s what I did.
Start with the positioning of my Right Column and leave all png stuff out.
div#rightColumn {
float: left;
width: 410px;
position: relative;
left: 30px;
font-size: 12px;
}
Create a second div within the RightColumn that will fill it 100%. This way you avoid the relative positioning and the a tags can be clickable.
div#rightColumn div. content {
float: left;
padding: 34px 60px 15px 30px;
width: 320px;
background: url(images/bg_floatedLayers.png) top left;
}
This is the IE filter hack.
* html div#rightColumn div. content {
background-image: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=”images/bg_floatedLayers.png”, sizingMethod=”scale”);
}
Lastly I added z-index’s to my a tags so they can be above the png. Not sure why you have to do this, but hey it works. Oh and for z-index to work, it needs a position.
div#rightColumn div. content a {
position: relative;
z-index: 1;
}
It is a ton of extra work between figuring out the solution and implementing it. Hopefully people will stumble on this solution quicker than I did. Makes me wonder if Microsoft is liable for all of the time we spend catering to their browser. It’s ridiculous. Yes, I am annoyed right now.
The site I am relaunching is nicholasgalanin.com and I will further illustrate it when I launch.
Popularity: 10% [?]
Comments for A PNG IE Nuisance
Recent Entries
Welcome to the Website of Eleven3. I like to build clean websites, period.
This Is George Huff
He is a web designer / entrepreneur / conspirator / blogger / fianceé living in Portland, Oregon.
When not fully immersed building websites, he runs a record label, writes music, throws a music festival, grows vegetables, and happens to be a huge advocate of his friends and family.
Currently My Latest Twitter
it's slowly turning into a work night. Gotta say it is going to be tough getting anything done on a Sunday for awhile. 5 hrs ago Follow Me
Featured Work My Portfolio
Topics You've made it this far
- Alaska
- Apple
- Applications
- Browsers
- Business
- CMS(s)
- Community
- Conferences
- CSS
- Education
- Freelance
- General
- HomeSkillet Records
- How To
- Inspiration
- Internet
- JavaScript
- Marketing
- Microsoft
- Partners
- PDX
- Plug-Ins
- Portfolio
- Print Design
- Pub-Love
- Ruby On Rails
- Standards
- SXSW
- Uncategorized
- Usability
- We The Media
- Web Design
- Web Services
- XHTML
















John Labriola November 14th, 2006 at 1:14 pm
I’m a little behind in my feed reading and just came across this today. But awhile back I had the same issue and came across something called bslight.js, it worked but was a little old and intrusive. Eventually I modified it, here’s what I did, it takes out the CSS hacks and filters and puts it in extermal JS.
http://www.flopidesign.com/2006/05/26/transparent-pngs-used-as-css-background-images-in-internet-explorer/
George November 14th, 2006 at 10:37 pm
It seems like the CSS version is less code, but sloppier. Either way, it becomes whatever you are comfortable with. Just attach a seperate stylesheet for all the IE PNG hack code.
John Labriola November 15th, 2006 at 3:46 am
Yeah the CSS one is a little sloppy, but once you implement it there is no maintenance or anything, and it validates.
Yeah all the fixes I have come across are a bit hacky, but hey what do you expect when trying to work around IE’s constraints?
George November 15th, 2006 at 10:30 am
Pull your hair out! We will see how long this has to last. A year or two or three? I still have people ask about IE 5.5 and that is 4-5 years dead. I’m a bit of a snob when it comes to development for old browsers.
Live in the now is what I say! Hehe.