Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

White space is still present around the iframe border even after after setting frameborder to 0

Even After setting the frameborder attribute in the iframe to 0 there is still some white space present around the iframe border (unlike the original url/link page). Is there any other way to get rid of the white space or some white must be presented around the iframe as it is within the webpage (or part of it) and it cannot be the whole page? Thank you.

like image 611
Muaz Avatar asked Oct 26 '10 08:10

Muaz


3 Answers

Maybe that whitespace is actually the outside margin of the document loaded in the <iframe>. Try styling the loaded document with:

html, body {
    border: 0px;
    margin: 0px;
    padding: 0px;
}
like image 50
Frédéric Hamidi Avatar answered Nov 16 '22 03:11

Frédéric Hamidi


Apply below to iframe

display: block
like image 28
Nagavardhan Raju Avatar answered Nov 16 '22 03:11

Nagavardhan Raju


By adding this CSS we can make iframe in full screen

body,html
{
    background-color:#DDEEDD;
    padding:0px;
    margin:0px;
    height:100%;
    width:100%;
    overflow:hidden;
}
iframe
{
    margin:0;
    padding:0;
    border:none;
    overflow:hidden;
    background-color:#DDEEDD;
}
like image 33
Prem Kumar Maurya Avatar answered Nov 16 '22 04:11

Prem Kumar Maurya