开发者

Chrome Iframe display White Box

开发者 https://www.devze.com 2023-01-04 17:28 出处:网络
Aloha, currently my pligg template have following Iframe code : <iframe heigh开发者_StackOverflow社区t=\"0px;\" width=\"0px;\" frameborder=\"0\" name=\"story_status\"></iframe>

Aloha,

currently my pligg template have following Iframe code :

<iframe heigh开发者_StackOverflow社区t="0px;" width="0px;" frameborder="0" name="story_status"></iframe>

Its working fine on firefox, however on chrome, it display as white box..

after inspecting,

<iframe height="0px;" width="0px;" frameborder="0" name="story_status">
<html><head></head><body></body></html>
</iframe>

body have margin: 8px;

EDIT : [ view this on chrome & firefox, u can notice white box on chrome ]

<html>
<head><style>html, body {
    margin: 0;
}
</style>
</head>
<body style="background : #000; color: #fff;">
aaaaa<iframe height="0px;" width="0px;" frameborder="0" name="story_status"></iframe>bbbbb
aaaaaaaaa
</body>
</html>

Is there anyway to remove margin 8px as it display as white box on chrome?

thank you for help


I had similar problem. I just put the <iframe> into <div> as follows:

<div style="visibility:hidden;">
  <iframe ...></iframe>
</div>


Try setting display: block on your iframe, it will obey the height and width rule then.


Add the following CSS rule in the <iframe>:

html, body {
    margin: 0;
}

Alternatively, try adding the following CSS rule to the parent page (which contains the <iframe>):

iframe {
    margin: 0;
    padding: 0;
}


Add the following CSS

html {
    font-size:0;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消