gpt4 book ai didi

html - 溢出 :scroll not behaving as expected

转载 作者:太空宇宙 更新时间:2023-11-03 19:39:11 25 4
gpt4 key购买 nike

看下面的图片和代码:

enter image description here

<!doctype html>

<html>
<head>
<style>
body {
border: 1px solid red;
padding: 20px;
overflow: scroll;
}
</style>
</head>

<body></body>
</html>

overflow: scroll在元素内插入滚动条,但是 <body>元素没有占据整个网页,滚动条有什么问题?

谢谢

最佳答案

overflow:scroll 无论主体是否大于窗口,都会添加滚动条。您可能正在寻找 overflow:auto;

关于html - <body> 溢出 :scroll not behaving as expected,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4998291/

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