?
Solved

iframe bgcolor

Posted on 2006-11-01
5
Medium Priority
?
3,909 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Suggested Courses

752 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