我无法用h1元素创建全屏div的页面。仅当包含h1元素时,全屏div向下移动
以下网页的IE和Chrome呈现正确预期:含有红全屏格,没有滚动条:
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>title</title>
<style>
html {
background-color: purple;
}
body {
background-color: blue;
height: 100%;
margin: 0;
}
#main {
background-color: red;
min-height: 100%;
}
</style>
</head>
<body>
<div id="main">
<h1>
some text
</h1>
</div>
</body>
</html>
但是,对于火狐(27.0.1),我发现:
- 显示在页面
- 和垂直滚动条
- 顶紫线,如果我直接添加一些文字h1元素之前#main格,然后页面呈现预期。
我应该怎么做才能正确地在FireFox中使用h1中的文本进行渲染?
确定。它在FireFox – jozop
@jozef是h1保证金你应该阅读[答案](http://stackoverflow.com/questions/22234348/full-screen-div-is-shifted-down-when-contains-h1-element-only/22234462?noredirect = 1#comment33764309_22234462)的CBroe。我没有花时间回答关于问题的第二部分;他做到了。顺便说一下,他给我比我更多的信息。 – aloisdg