Adding bg color and text to a iFrame

I have an iFrame which I have adjusted to suit my needs..however I want to alter the background color of it AND I want to add text directly to the iFrame.<br />
<br />
I could just make a page and have it link to my iFrame but I want the text to be centered no matter what size window it is.<br />
<br />
Below is my iFrame code:<br />
<br />
<iframe name="myIframe" frameborder="1" vspace="1" hspace="1" marginwidth="1" <br />
marginheight="1" width="45%" height="50%"<br />
scrolling="no"></iframe><br />
<br />
I like the iFrame stats the way they are but I tried adding bg color tags to it, similiar to the other tags that control its hieght and all.<br />
<br />
Is there a relatively painless way to do this? Thanks<!--content-->i always thought that you had to have an SRC tag when using iframe - like src=http://www.webdeveloper.com/forum/archive/index.php/"red_background_document.html" and red_background_document.html had the <body bgcolor=red> tag in it? that's the only way i'm aware you can do it... :confused:<br />
l8rz<!--content-->When it comes to iFrames, it is a bit different I think. However I don't want a tiled background in this case, just a solid color, like black, but the code I am using now came from one of those O'Reilly books about DHTML and Javascript.<br />
<br />
I found a nice code for a iFrame but am struggling with having a bg color and text. And because it is all contained in the iFrame tags..there has got to be a way to add these attribute..I hope ;)<!--content-->You are supposed to use the src attribute...<br />
<br />
The only time you don't need it is if you're targetting a hyperlink to an image, and then you can load that into an iframe without using src.<!--content-->Okay..but what about adding text to it?<br />
<br />
But I really do not want to create a separate page just for the iFrame color..I thought one could add the bg color thing in the code..of course I tried it and it didn't work..bummer<br />
<br />
So it would look like this?<br />
<br />
P.S..Thanks<br />
<br />
<iframe name="myIframe" body bgcolor="black" frameborder="1" vspace="1" hspace="1" marginwidth="1" <br />
marginheight="1" width="45%" height="50%" src=http://www.webdeveloper.com/forum/archive/index.php/"black_background_document.html<br />
scrolling="no"></iframe><!--content-->Yes if you closed your src quotes<br />
<br />
you need to make a new page for every different thing you wish to display in the iframe, unless it's one image that you don't need to control background or position of.<!--content-->Okay..thank you.<br />
<br />
so now I closed the quotes but now I have to make a blank, black colored page for the iFrame, right? So I may as well just add the text to that...nuts..I was so sure there was another way.<br />
<br />
Anywhoo, thanks for the info.<!--content-->
 
Back
Top