Solved

iframe bgcolor

Posted on 2006-11-01
5
3,900 Views
Last Modified: 2009-03-26
Hi, i am using an iframe but i am not being able to set its bgcolor other than white.. I am using the following code:

<iframe id="dsd" ALLOWTRANSPARENCY="true" bgcolor="red" src="page1.htm" width=541 height=200>
</iframe>

I dont want to modify it in the src file's body, coz it is used in another page.. Can't I set it from the parent page as listed above?
0
Comment
Question by:zahir79b
  • 2
  • 2
5 Comments
 
LVL 30

Expert Comment

by:callrs
ID: 17849555
<iframe id="dsd" ALLOWTRANSPARENCY="true" style="background-color: red;" src="blank2.htm" width=541 height=200>
</iframe>
0
 

Author Comment

by:zahir79b
ID: 17849617
I have tried it and its not working.. and i also tried to put the color like 'red' and still not working.. and tried to change it in javascript document.getElementById("dsd").style.backgroundColor = "red" ... nothing working .. :(
0
 
LVL 19

Accepted Solution

by:
nschafer earned 50 total points
ID: 17849715
Hi zahir79b,

This works in IE and FF, I haven't tested with other browsers:

<iframe id="dsd" src="page1.htm" onload="window.frames[0].document.body.style.backgroundColor='red'";>
</iframe>


Hope this helps,
Neal.
0
 

Author Comment

by:zahir79b
ID: 17849758
Thnaks its working ok ..
0
 
LVL 19

Expert Comment

by:nschafer
ID: 17849787
Glad I could help,

Neal.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question