Solved

iframe bgcolor

Posted on 2006-11-01
5
3,901 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

856 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