Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Style background inside IFRAME

    Hello,

    Is it possible to style a background of a HTML page which is requested in the iframe?

    This because im making a video gallery for a client.
    Whenever he adds a new video, a completely new HTML file is generated with a white background color.

    I then request it in my iframe with
    Code:
    <iframe src="videogal/vidgal.html" frameborder="0" width="600" height="700"></iframe>
    I want the white to be transparent, but its hard for my client to edit the original html file each time he uploads a new video.

    Thanks in advance,
    Joep

  • #2
    Regular Coder COBOLdinosaur's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    411
    Thanks
    2
    Thanked 32 Times in 32 Posts
    Whatever is generating the page just needs to do the body tag as:
    <body style="background-color:transparent;">

    Or include a stylesheet with that as a rule.

    If the pages are being served from the same domain as the parent page, then you could probably do a scripted solution, but that would be rather excessive for such a simple problem.
    100% standards compliant code is 100% correct 100% of the time.
    one of my toys from my repository and perhaps some help getting help

    Cd&

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    850
    Thanks
    11
    Thanked 79 Times in 77 Posts
    What you see as the white background may not be a background color being set by any CSS rule. A browser, by default, will show the color for web pages that the user has set in Options/Preferences. Even if you set the body tag to have a transparent color, the user's browser will just show its default color. If you link each page to an external CSS file, you can better control what the overall page looks like.

    If you want the background of the iframe transparent, then set it with a CSS rule, but you'll still see the browser's default background color through the transparency. You could use CSS 3 for some great effects or make a small 1 X 1 px transparent or 25%-50% opaque image.
    ☠ ☠RON☠ ☠


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •