Results 1 to 6 of 6

Thread: Iframe spacing problem, help please

  1. #1
    Join Date
    Oct 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Iframe spacing problem, help please

    I have an iframe in my page, and there is space in the top and the bottom of the frame that is the same as the background color and I can't figure out how to get rid of it. See attached image.

    www.cynergy.tv/test/people.php

  2. #2
    Join Date
    Jul 2006
    Posts
    497
    Thanks
    8
    Thanked 70 Times in 70 Posts

    Default

    Your problem is actually in the CSS of this page, and it applies to the page's bottom as well: http://www.cynergy.tv/test/bios.php
    Code:
    body {
    	/*...*/
    	margin-top: 15px;
    	margin-bottom: 15px;
    	/*...*/
    }
    Remove those lines and the black will disappear on all pages that use that CSS.
    -- Chris
    informal JavaScript student of Douglas Crockford
    I like wikis - a lot.

  3. #3
    Join Date
    Oct 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default helped but didn't totally fix

    Hey Chris, that got rid of the space on the bottom of the iframe but not the top. Anymore suggestions would be awesome, appreciate what I have got so far.

  4. #4
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    "bgcolor" is deprecated. You should use css to declare the background color in your stylesheet. I'm guessing you were probably trying to "override" something somehow, but it doesn't work either way. So in the source of your iframe, you should remove this...

    Code:
    <body bgcolor="#ffffff">
    Also, the reason you have that dark section at the top of your IFRAME is because the iframe is using the same stylesheet as the main page (main.css), and in that stylesheet the attribute "background-color" is set to a dark color ( background-color:#2C3438; )

    I changed it to "#ffffff" using firebug and it did not affect the "parent" page, so I'm assuming you could probably change it without it affecting anything.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  5. #5
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    if you don't like the solution above, you could also try this approach...

    In the source of your iframe (bios.php), add this to the head section.

    Code:
    <style type="text/css">
    /*IFRAME MARGIN OVERRIDE*/
    body {
    margin:-15px auto 0 !important;
    }
    </style>
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  6. #6
    Join Date
    Oct 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks you sooooo much!

Bookmarks

Posting Permissions

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