我正在尝试将#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 {
margin:0;
padding:0;
height:100%;
}
P / S:也许是时候尝试flexbox
#app {
height: 100vh;
}