Home

Lullabot

Lullabot Ideas

We know stuff. We empower you to know stuff too.

On Site Drupal Training

We'll come to you! Graduate from your own on-site courses and become Drupalistas!

IE iFrame Insanity

Blog by Karen StevensonFebruary 9, 2010 - 2:52pm

After I spent THREE HOURS trying to figure out why IE insists on rendering a white background for an empty iframe, Nate pointed this little gem out to me.

IE has default values for iframes. Yes they do. And the default is to put an opaque background and an inset border on iframes that will ignore any attempt you make to change the iframe background color or border using css. So if you put 'background-color:transparent' into your css for the iframe element it will have no effect. That's right IT WILL IGNORE YOUR CSS!

To fix it you have to do this:

<iframe allowtransparency="true" frameBorder="0"></iframe>

See the documentation for this stupid behavior here

- http://msdn.microsoft.com/en-us/library/ms533072%28VS.85%29.aspx
- http://msdn.microsoft.com/en-us/library/ms533770%28VS.85%29.aspx

Comments

Mike (not verified) on May 9, 2010 - 3:13am

Big business is a very tricky

Big business is a very tricky thing! Sometimes it is hard to control everything though this problem couldn't be unnoticed but it remained unsolved. Well, what is the reason for it? There could be lot's of them! I've read a book about large companies (found it at rapidshare SE http://rapidpedia.com ). It is strange but the greater company becomes the more it becomes directed towards mass production where quality becomes less important than it was earlier.

Christian Bromann (not verified) on May 3, 2010 - 7:43am

banishment of explorer user

some agencies, with whom I work, relegate IE user now complete from the site, with the note, they should change the browser. is that the right solution?

Anonymous (not verified) on March 12, 2010 - 8:11am

Why

Why exactly do people use iFrames. I use them sometimes when I am working within certain CMSes and need dynamic content on the fly, but when I am running on my own server, why not just use an include?

March 20, 2010 - 7:14am Karen Stevenson

To speed up page loads

We use iframes to wrap ads and widgets to speed up the page load. This was a site with a lot of ads and widgets being served from other domains and all the http requests were making the home page load too slowly. By moving the code that is loaded from external sites into iframes the rest of the page can load quickly and you just have an empty spot on the page for any remote requests that would have slowed the page down.

Anonymous (not verified) on February 22, 2010 - 4:18pm

IE6 is 9 years old

get over it

Anonymous (not verified) on March 3, 2010 - 8:37pm

how?

A large percentage of people are is still using it. How do you suggest everyone "get over it"?

joshmiller (not verified) on February 18, 2010 - 7:11am

Thanks

Thanks Karen. Saw this article when it was posted and you just saved me what was surely 3+ hours of research when I ran into this exact issue with Internet Explorer.

Josh

Anonymous (not verified) on February 16, 2010 - 12:17pm

boycott!

I'm with you guys - let's boycott IE development!!!

*secretly pimps himself out to commercial interests that want massive browser coverage and makes a fortune*

sandra qu (not verified) on February 16, 2010 - 9:56am

If we don't build it, they must come

I am in full support of this suggestion, and think we should make it an official movement. If we don't support IE, people will be forced to seek an alternative. I think we should simply put a CSS conditional (you know, those special ones made especially for IE <!--[if IE]> If Internet Explorer doesn't work well, <a href="http://www.mozilla.com/">Download FireFox</a><![endif]--> and be done with it.

Anonymous (not verified) on February 12, 2010 - 10:51am

Couldn't agree more (with

Couldn't agree more (with all of you)! IE is a piece of crap, and Microsoft is totally useless ! It's just so strange. All the other browsers render pretty much the same, and IE just fu%#s it all up ! Is it so difficult to make a decent IE ? Just steal the code from Firefox mr.Gates, for god's sake man !

Martin (not verified) on February 11, 2010 - 5:28am

This doesn't suprise me at

This doesn't suprise me at all. Another triumphant backdraft of using the worst browser in the world.

If you think that is already a problem, wait until you want to use HTML 5 on IE, that's not going to happen and we still have to create websites and appliations double tracked.

Man, IE, what a piece of s**t.

seutje (not verified) on February 11, 2010 - 3:04am

oh IE, bane of our existence

heh, I remember this one, but instead of trying to figure it out for 3 hours, a quick google for "IE iframe transparency" would of undoubtedly pointed you to one of the many rather helpful pages out there.

Google is your friend, don't hate it ;)

George (not verified) on February 11, 2010 - 5:33am

ie iframe background

Even a quick Google for "ie iframe background" would have brought you the answer pretty quick. But I know from experience that in retrospective any problem is trivial once you've been pointed to the right direction.

February 12, 2010 - 10:52am Karen Stevenson

Right, easy to see now the

Right, easy to see now the iframe was the problem, and I would have found a solution sooner if I was looking in that direction. But I was working on some absolutely positioned iframes, and I know that IE6 has all kinds of problems around absolute positioning, so I spent my time searching for absolute position bugs because I didn't realize the iframe was the problem.

That's the problem with these bugs. You can find a solution if you know what is broken, but there are so MANY candidates for what might be broken that you may not always attack it in the right way.

And in case you wonder why in the world any self-respecting web developer would be using iframes in the first place, we were using them to wrap ads so they wouldn't slow down the page loads.

Anonymous (not verified) on February 10, 2010 - 3:22pm

can we just stop

Can we just all collectively break the web, please? We stop supporting IE. Sure you can make a car that runs on frozen kiwi's. But we will not sell frozen kiwi's at gas stations.

It will be painfull sometimes, but mainly just ugly. And people will learn. And life will get better.

J. (not verified) on February 9, 2010 - 8:13pm

What's Internet Explorer?

What's Internet Explorer?

Travis (not verified) on February 9, 2010 - 4:25pm

Class Action Suit

I'm filing a class action lawsuit against Microsoft for all the time and money developers around the world have flushed down the toilet trying to support Internet Explorer. Who's with me?

Anonymous (not verified) on March 3, 2010 - 8:35pm

Yep!

Yes, me too. I think it would bee a good idea to include everyone who's ever used Vista or any other Microsft product.

Anonymous (not verified) on February 10, 2010 - 4:27am

Every Webdeveloper

I Think every web developer in the universe is with you on that one. For every version on Internet Explorer. Remember when IE5, IE5.5 & 6 used to be the best web browsers

Recent

Drupal Voices 160: Moshe Weitzman on Page Rendering in Drupal 7

Podcast 9.02.2010

Drupal Voices 159: John Albin Wilkins on Drupal 7 Theming

Podcast 9.01.2010

Drupal Voices 158: Emma Jane Hogbin on PHP for Designers

Podcast 8.31.2010

Command Line Basics: More Editing with Vi/Vim

Video 8.31.2010

Lullabot's Back to School Sale

Blog 8.30.2010

Popular

Drupal Voices 160: Moshe Weitzman on Page Rendering in Drupal 7

Podcast 9.02.2010

Photo galleries with Views Attach

Article 6.01.2009

Drupal Voices 159: John Albin Wilkins on Drupal 7 Theming

Podcast 9.01.2010

Drupal Voices 158: Emma Jane Hogbin on PHP for Designers

Podcast 8.31.2010

Assembling Pages with Drupal

Article 7.17.2010
 
  • Home
  • Services
  • Events
  • Ideas
  • Store

Connect the Bots:

Twitter Facebook YouTube blip.tv All Posts Newsletter
  • Ideas
  • Blog
  • Podcasts
  • Videos
  • About
  • Contact
  • Jobs
  • Services
    • Training
  • Events
    • Training Workshops
    • Other Events
    • Conferences
    • Calendar
  • Products
    • Videos
    • Books
    • Swag
  • Ideas
    • Blog
    • Podcast
    • Videos
  • About
    • Philosophy
    • Team
    • Presskit
  • Contact
    • General
    • Work Inquiries
    • Mailing List