我有以下index.html页面:
<html>
<head>
<style>
html, body {
height:100%;
}
</style>
</head>
<body style="height:100%;">
<div style="width:100%; height:100%;">
<div id="theHead" style="height:10%; ">
</div>
<div id="theMain" style="height:80%;">
</div>
<div id="theBottom" style="height:10%;">
</div>
</div>
</body>
</html>
这是在iframe中:
<iframe id="theIframe" src="index.html" width="800px" height="450px">
Hello World...
</iframe>
我看到一个滚动条出现在iframe上,可以进行轻微的滚动。
为什么发生滚动?
我明白了。因为您必须更改浏览器的CSS默认值才能在reset.css或normalize.css中使用
删除边距示例:
index.html页面:
<html>
<head>
<style>
html, body {
height:100%;
margin:0px; //--> added this line
}
</style>
</head>
<body style="height:100%;">
<div style="width:100%; height:100%;">
<div id="theHead" style="height:10%; ">
</div>
<div id="theMain" style="height:80%;">
</div>
<div id="theBottom" style="height:10%;">
</div>
</div>
</body>
</html>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句