我得到了一些奇怪的事情与一些CSS和HTML代码。下面的代码在浏览器Chrome,Firefox中使用时效果很好,但是当使用开发人员工具并使用移动视图时不明白为什么,但最小高度:100%;不适用?包括一个截图。因此,在正常的浏览器工作正常任何想法这是为什么?谢谢!高度宽度以百分比CSS html一些奇怪的东西
*,
*::before,
*::after {
box-sizing: inherit;
}
* {
position: relative;
}
a,
body,
footer,
header,
h1,
h2,
html,
img,
li,
p,
section,
span,
sup,
ul {
background: transparent;
border: 0;
font-size: 100%;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline;
}
html {
box-sizing: border-box;
height: 100%;
overflow-x: scroll;
overflow-y: hidden;
width: 210%;
}
body {
background: red;
color: #FFFFFF;
height: 100%;
margin: auto;
overflow: hidden;
width: 210%;
}
section {
display: block;
float: left;
height: 100%;
width: 100%;
}
.test {
float: left;
min-height: 100%;
overflow: hidden;
width: 20%;
}
<body>
<section class="test" style="background-image: url('https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-95348.jpg');">test</section>
<section class="test" style="background-image: url('https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-95348.jpg');">test</section>
<section class="test" style="background-image: url('https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-95348.jpg');">test</section>
<section class="test" style="background-image: url('https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-95348.jpg');">test</section>
<section class="test" style="background-image: url('https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-95348.jpg');">test</section>
</body>
来自于Chrome的开发工具截图:
怎样才能使它在开发工具也是100%的高度?
有什么想法?
THX!
我认为它是因为开发人员工具从100%离开窗口的百分之71而不是100%。 – Keith
你没有打开'body'tag(有第二开口头标记) – Johannes
不解决这个事情之前关闭'head'标签:X和开发工具是相同的结果100%的窗口。 :\ – derder