我在我的页面中使用 iframe,并且偶然发现了一个奇怪的问题。我像这样设置iframe css
iframe {
margin: none;
padding: none;
background: blue; /* this is just to make the frames easier to see */
border: none;
}
但是,iframe 周围仍然存在空白。我在 Chrome 和 Firefox 中都测试过,结果是一样的。我四处寻找,我找不到任何东西。这个空格也不会出现在 Chrome 控制台中。另外,我也已经有了以下 CSS:
html, body {
margin: 0px;
padding: 0px;
border: 0px;
width: 100%;
height: 100%;
}
JSFiddle:这里