html - IE——全屏,内容居中

标签 html css internet-explorer fullscreen

我已经根据 this answer 中的 css 和 html 设置了一个内容区域固定宽度和可变高度、水平和垂直居中的网站。 .

这在我测试过的所有浏览器中都运行良好,即使在 IE (11) 中也是如此。然而,该页面也需要在全屏模式下工作,如果我在 ie 中运行它,内容会转到左上角。

这是我的 html:

div.wrapper-1 {
 display: table;
 position: absolute;
 height: 100%;
 width: 100%;
}

div.wrapper-2 {
 display: table-cell;
 vertical-align: middle;
}

div.wrapper-3 {
  margin: 0px auto;
  width: u($page-width);
}
<body>
    <div class="wrapper-1">
        <div class="wrapper-2">
            <div class="wrapper-3">
            <!-- does all my content go -->
            </div>
        </div>
    </div>
</body>

我该怎么做才能使它在全屏模式下也能正常工作?

感谢您的帮助!

最佳答案

最后,在深入研究之后,我可以启动并运行它!

我将其添加到我的 CSS 中:

html {
    width: 100%;
    height: 100%;
}

关于html - IE——全屏,内容居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25935067/

相关文章:

html - 如何在 ie 11 中创建 css 双线直通?

表格消失后的 HTML 内容

jquery - 获取变量的 css 值

javascript - 无法使用javascript更新css中的图像位置

Java JNI : possible to manage cache, 历史记录,IExplorer 中的临时文件?

html - 阻止包含 span 的单词换行?

html - 不同机器上的 IE 8 不呈现相同的颜色

html - 表单下拉列表位于固定标题上方

javascript - jQuery UI 可排序 - 表格单元格在排序时丢失边框

php - Internet Explorer 无法处理多个查询