【发布时间】:2016-08-11 20:50:45
【问题描述】:
我最近发现我在 google chrome 中的内容长度超过 16777216px 时没有被渲染。
完整的 HTML:
<html>
<head>
<style>
#content {
height: 16777316px;
position: relative;
font-size: 2em;
font-weight: 700;
}
#semi-hidden {
position: absolute;
bottom: 0;
background-color: #000000;
color: #ffffff;
height: 200px;
width: 50%;
float: left;
}
#hidden {
position: absolute;
bottom: 0;
background-color: #ffffff;
color: #000000;
height: 100px;
width: 50%;
float: right;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<div id="content">Scroll Down ↓
<div id="semi-hidden"> The Bottom 100px of this DIV is not rendered. </div>
<div id="hidden"> This DIV is completly hidden. </div>
</div>
</body>
</html>
编辑:这是由于 Google Chrome 不支持大于 16777216 像素的布局。
【问题讨论】:
-
也许是因为那太长了?在超过四英里长的 60dpi 显示器上
-
请注意,您发现的数字可疑地接近 16,777,216,即 2²⁴。
标签: javascript jquery html css google-chrome