Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

iframe bgcolor

Posted on 2006-11-01
5
Medium Priority
?
3,911 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

604 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