gpt4 book ai didi

html - Height:100% 和 Margin 问题,延伸超过 100%

转载 作者:行者123 更新时间:2023-11-28 08:56:08 24 4
gpt4 key购买 nike

这是我的 Playground 链接: http://cssdeck.com/labs/7u6ex40p

如您所见,我已将其高度设置为 100%,但它的边距超出了 100%。显然这是因为边距,我试过更改它们,使边距为 2%,高度为 96%,但这没有用。我在这里结束了。

干杯,克里斯

最佳答案

不是为 pageborder 设置边距,而是为 body 设置 padding 并将 box-sizing 设置为 border-box。

html, body {
height:98%;
width:100%;
-webkit-tap-highlight-color: transparent;
-webkit-font-smoothing: antialiased;
background-color:#fff;
margin:0;
border: 0;
padding: 2%; /* changed */
box-sizing: border-box; /* changed */
}

#pageborder {
background: rgba(86, 86, 86, 0.06);
height:100%%;
}

http://cssdeck.com/labs/vla26uvc

关于html - Height:100% 和 Margin 问题,延伸超过 100%,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27116303/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com