IE bold text + opacity problem
You know how IE's alpha opacity filter ruins boldface text?
<div style="width:100%;
filter:alpha(opacity=90);
font-weight:bold;">
Hello world!
</div>
If you're using IE, you can see the problem in action here:
Hello world!
I discovered this while tweaking the opacity filter function I wrote about earlier.
After much fruitless Googling and consulting with webdev experts, I couldn't find a fix. And like most solutions, I had to stumble upon it at the eleventh hour: adding a background color or image to the container element will fix the IE opacity rendering problem.
<div style="width:100%;
filter:alpha(opacity=90);
font-weight:bold;
background-color:#fff">
Hello world!
</div>
Here it is again, with the fix:
Hello world!
Hopefully the search engines will find this page and no one will have to suffer as I have ever again.
UPDATE: SZOJ reader Andre points out that this bug probably surfaced when MS introduced ClearType rendering, which probably explains why the bug goes away when "font smoothing" is disabled.

38 Comments:
p.s. yes, I am aware that the blog layout is hosed in IE. Dunno when that happened, but I'm working on it. ;)
Interesting... a while ago I found a duplicate characters but in IE that could be fixed by applying a background color:
http://www.bingbangboom.us/projects/cssFixes/floatRowIE6/
background: transparent also made the fix work, strangely enough...
Seems to me that this could be fixed/applied automatically using CSS JS expressions. Though I don't use them that much so I might be wrong.
Can anyone provide the code for this. Basically, set the item with alpha set's background to be the same as it's parent.
Gee, i'm using IE6 right now and cannot see a difference between the two examples...
You are officially awesome :) This should have been shouted from the rafters by the MSDN the moment this bug surfaced whem ClearType was introduced. (Incidentally, those of you that don't see the difference in IE6 may not have ClearType enabled). You might also be happy to know that the fix also applies to text that is vertically rotated to read from bottom to top. Excellent work figuring this out.
Andre: yeah, a few people pointed out that disabling "font smoothing" seemed to fix the problem. However, that's not something we can force from the client side.
Actually, Scott, it is possible to disable ClearType from within the browser (it involves a call to a standard ActiveX object that Microsoft ships, and proper security settings). The problem is that it disables it for the whole OS, not just for the browser, so that method is highly discouraged. If I can find the reference for it I'll send it to you.
Hi Blogger, I've been searching around for ugly blog related blogs to get some ideas and possibly trade links with. I found this entry (IE bold text + opacity problem) in my search so I thought I'd post a quick note to let you know. Anyway I have a new blog called Ugly Blog, so feel free to check it out but don't feel obligated. Take care - Eric
How would you like to know about a Cardinal Fitness resource, that displays all the Cardinal Fitness information on one website? Check out
Cardinal Fitness today. Not only do they have a good fitness book section, but they also have great articles on fitness. I was really impressed with the resources their webmster put together.
heya
I've spent probably 12 hours on this problem over the last couple of days and finally came across your tip. Thanks very much for sharing!
I wanted to show you some superb resourses on the net.
Learn to earn 90000$/Month
For which you may also see my Personal Website
Here.
and for a Personal Education Career Tools
free Study Database.
This site is for seeing the
Hifi Electronics.
And this is for
World Class Gadgets
Please visit Ayesha Takia's Fan Site and tell us how it is - Ayesha World
Please visit Ayesha Takia's Fan Site and tell us how it is - Ayesha World
Nice one - thanks for writing about this.
Hello Friend i wanted your help in winning me the World's Biggest SEO Contest for v7ndotcom
elursrebmem and also the v7ndotcom elursrebmem
So can you please put my websites link in your website.
Also Please Check out more details at my Get paid to post forums
THANK YOU!!!
I was using your opacity script and ran into the same problem and nothing would fix it...until i found this post! great!
You saved my hair again. Thank you. I have been having lots of problems with IE until I found your post.
Much thanks for sharing this fix. I ran into the problem by using a javascript library (moo.fx), but I'm sure other libraries would run into the same problem too - prototype, script.aculo.us, etc. Someone mentioned that using "background:transparent" would fix the problem, but it didn't work for me, neither did using a transparent gif background image.
A simple solution to an obscure problem. Well done!
Thank you!
background:transparent didn't work for me, but a solid color did. Wonderful.
Your awesome!
That was a great fix. I found it pretty quickly on google.
Thanks! Potentially millions of my company's users will enjoy the fruits of your labors. :)
Very much appreciated - saved me from a major headache.
Thank you so much! You saved me many headaches and time with that problem on my blog!
THANK YOU! You saved me.
Two years on, and I've just hit this same problem playing with a jQuery plug-in. I can confirm it affects IE7 in the same way as IE6. Nothing got fixed there, so it may be an OS rendering problem rather than a browser problem.
Thanks for posting the solution - has saved me many hours of effort.
HI DANIIL KULCHENKO!
I KNOW ABOUT YOU!
YOU GO TO EAS AND ARE IN 7th GRADE!
SO TAKE THAT!
WATCH YOUR BACK! NOT A THREAT JUST A FRIENDLY REMINDER!
thanks for this. it was driving me insane until i found your post. sheers.
Ayesha takia hot nude sexy bikini wallpapers free
Great solution. Thanks for saving another XX hours of cursing IE (which I liked a lot until now)
Hi, I found this same problem to also happen with transparent png's as the background of an anchor element. Here is a site I am working on at my job. Look at the black scroller triangles in IE 7. I am really lost with this one, but it seems that the bolding problem is happening to the image. More weird than that is that there are no bolding rules for anchors in the body of the document, which is where these scrollers are. I cannot add a background-color to these because they need to be transparent. Do you think this is the same problem?
Thanks a lot, I was going crazy with this bug in IE6.
Moreover I found out that IE7 have some similar problems using ClearType. Not really the same but using Scriptaculous fade in(Appear), disables ClearType rendering on text.
I found out a patch to jQuery that is extensible for Scriptaculous adding this line in Effect.Appear.afterFinishInternal:
if(Prototype.Browser.IE)effect.element.style.removeAttribute('filter');
In a note to jason, this error is of course nothing to do with the OS but with the browser, as Firefox and Safari (and maybe Opera) don't manifest this weird behavior in Windows.
Cool blog - Check out my site if you need help finding a good low interest credit card. Credit Cards
Just three little words: GOD BLESS YOU !!!
You save me from the biggest problem that i ever had.
Thank you and good look always.
Why dont you use Mozilla firefox download http://www.mypiju.com
THANK YOU! I've spent half of my day putzing around Google trying to find a fix and I finally found this blog post. Our company has been trying to find a fix for t his for a long time now!
Best!
Post a Comment
<< Home