visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Web :: Browser issues :: Firefox versus Internet Explorer with IFRAME contained in DIV problem.


By: Bernard France  Date: 02/05/2006 09:41:46  French English  Points: 20 Status: Answered
Quality : Excellent
Salut, j'ai un énorme problème et je n'arrive décidemment pas à trouver une solution :
J'ai créé une page avec un DIV qui contient une IFRAME. Je fais que la div soit à 20 pixel du bord et que son contenu soit à 10px de la div. L'Iframe doit avoir une taille de 100%.
In short, I've a DIV containing an IFRAME, with distances set so that they fit the one to the other.

Aucun problème avec Firefox, tout marche correctement (normal me direz vous), mais quand je teste avec Internet Explorer j'ai mon iframe qui dépasse de ma div et même de ma page. Overflow IFRAME versus DIV problem ? Or browser bug ? Position problem with DIV in Internet Explorer ?

Par contre, si je redimmensionne la fenètre de IE, l'iframe pred automatiquement la bonne taille (?) mais si je recharge la page, l'iframe sort à nouveau de la div (???).
Each time I resize the browser's window, things are correctly arranged again, but each time I press "reload", the IFRAME "gets out" again of the DIV border.

Merci d'avance.

Voici mon code :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <meta name="generator" content="PSPad editor, www.pspad.com"> <title></title> </head> <body> <div style="padding:10px;margin:20px;border:solid red 1px;"> <iframe style="width:100%;"> </iframe> </div> </body> </html>

By: VGR Date: 02/05/2006 09:44:17 English  Type : Comment
Hello, you may simply try to say style="width:100%;" for the DIV...
By: Bernard Date: 02/05/2006 09:48:08 French English  Type : Comment
ça marche bien, mais maintenant nouveau problème avec Firefox : le div principal prend 100% de la largeur de la fenêtre, donc avec ma marge de 20 px et un padding de 10 px, elle dépasse de 30 px sur la droite...

the DIV now spans 30px too far on the right using Firefox...

By: VGR Date: 02/05/2006 09:51:09 English  Type : Answer
Well, the quick & dirty solution is clear : only include the "width:100px" CSS rule for IE ;-)

There is a client-side solution, using the integrated scripting system of Internet Exploder ; use this kind of code :

<!--[if IE]> <link rel="stylesheet" href="style/ie.css" type="text/css" /> <![endif]-->



where the ie.css file would contain the "width:100%;" rule for the DIV

I don't like this, but it's easy.

Do register to be able to answer

EContact
browser fav
page generated in 669.896840 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page