Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
有时html高度:100%不';不要把整个窗户都填满_Html_Css_Google Chrome - Fatal编程技术网

有时html高度:100%不';不要把整个窗户都填满

有时html高度:100%不';不要把整个窗户都填满,html,css,google-chrome,Html,Css,Google Chrome,我得到了一个标题和一个可编辑的内容框,上面有这个css: html, body { height: 100%; } body { overflow: hidden; } .header { height: 100px; line-height: 100px; background: wheat; } .content { border: 1px solid #333; width: 80%; height: calc(100% -

我得到了一个标题和一个可编辑的内容框,上面有这个css

html, body {
    height: 100%;
}
body {
    overflow: hidden;
}
.header {
    height: 100px;
    line-height: 100px;
    background: wheat;
}
.content {
    border: 1px solid #333;
    width: 80%;
    height: calc(100% - 100px);
    overflow: scroll;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 10px;
}
html:

<div class="header">Header</div>
<div class="content" contenteditable="true"></div>
标题

内容的滚动条出现时,单击返回键,html将不再填充页面

这张图片显示了正在发生的事情:

如您所见,html大约是10px的剪切。 正如我刚才所说,每次我的两个朋友这样做时,这种情况也会发生在他们的电脑上,但这种情况从未发生在我的电脑上,我们处于相同的环境中

环境: mac pro,chrome版本:42.0(safari中未出现)

我所做的: 当我尝试将
position:fixed
添加到html元素时,它起作用了,问题就消失了

我的问题: 我想知道,这是一个错误的铬?为什么
position:fixed
可以修复它,发生了什么


在我的真实项目中,主体是
{margin:0}
,但问题仍然存在,但如果演示程序具有
主体{margin:0}
,我会感到困惑。

在我的真实项目中,主体具有
{margin:0}
,并且我的网站标题将被削减10px。将主体边缘设置为零将解决此问题:{height:calc(100%-100px);}错误。必须考虑边框和填充。请参见框模型框大小为边框-box@super-xp在这种情况下,你能展示完整的css吗,这样我们就不必猜测了?或者更好的是,创建一个示例,例如在中演示这个问题。