Web :: Browser issues :: Firefox versus Internet Explorer with IFRAME contained in DIV problem. |
|||
| By: Bernard |
Date: 02/05/2006 09:41:46 |
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 | Type : Comment |
|
| Hello, you may simply try to say style="width:100%;" for the DIV... | |||
| By: Bernard | Date: 02/05/2006 09:48:08 | 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 | 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 |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








