【发布时间】:2020-08-03 14:17:23
【问题描述】:
我正在尝试将#app 设置为 100% 高度,但无法实现。 div #app 不被视为 Body 的孩子吗?我每次都遇到这个问题,而且每次我都必须以不同的方式解决问题。
有没有办法完全避免这种情况发生? CSS:
* {
margin: 0;
padding: 0;
font-family: "Nunito";
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
html {
height: 100%;
}
body {
transition: background 0.25s ease-in-out;
min-height: 100%;
}
#app {
max-height: 100%;
min-width: 100%;
position: relative;
}
【问题讨论】:
-
你试过 html, body, #app { height: 100% } 吗?
-
@Anatoly 是的,但由于某种原因,它会创建滚动条溢出,在页面底部形成一个白条(我有背景色,但它以白条结束并继续) .我设置了 max-height: 100%;在#app 中试图消除此问题