View Full Version : help with Javascript for style a external Iframe

11-28-2012, 03:48 AM

i need to add style="background:transparent" in the body of an external frame:

<iframe name="frm" src="external link">
<body class="modelo3" style="background: transparent;">




I tried with javascript, but no way.

Thanks in advance.

11-28-2012, 02:58 PM
In the iframe definition add allowtransparency="true"
See if that helps.

11-29-2012, 05:39 PM
Thanks for the idea, but it doesn't work.

11-29-2012, 08:52 PM
Maybe you should post the code your using and not a snip it.

11-30-2012, 04:10 AM
<div class="custom" >
<iframe frameborder="0" height="395" scrolling="no" src="EXTERNAL LINK" width="648">

The code of the external frame is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="es">
<meta http-equiv="Content-type" content="text/html; charset=UTF-8">

<!-- CSS -->
<link rel=.../>
<link rel=.../>
<link rel=.../>

<body class='modelo2'>

more code of body that cames from the external frame...


AND I NEED TO PUT IN SOMEWAY <body class='modelo2' style="background:transparent">

11-30-2012, 11:52 AM
May be you needs to write transparency css on class called "modelo3" I am not sure but may be you can do using CSS3

11-30-2012, 11:56 AM
The body has no intrinsic background color, so there’s no point in setting it to “transparent”. I suppose you want the iframe to have a transparent background color?
It would help if you showed us a live example and mentioned the browser in which the issue occurs.

12-05-2012, 12:53 AM
css class "modelo3" has a background defined... and i need to overwrite it using "style='background...'

this is my iframe: http://booking.iberiatrip.com/public/widget/1321/2240371588