PDA

View Full Version : Iframe spacing problem, help please



designerkj
10-15-2008, 09:04 PM
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

Jesdisciple
10-15-2008, 09:41 PM
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
body {
/*...*/
margin-top: 15px;
margin-bottom: 15px;
/*...*/
}Remove those lines and the black will disappear on all pages that use that CSS.

designerkj
10-15-2008, 10:51 PM
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.

TheJoshMan
10-16-2008, 12:15 AM
"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...



<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.

TheJoshMan
10-16-2008, 12:25 AM
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.



<style type="text/css">
/*IFRAME MARGIN OVERRIDE*/
body {
margin:-15px auto 0 !important;
}
</style>

designerkj
10-16-2008, 03:13 PM
Thanks you sooooo much!