所以我有一个包含多个对象的基本页面。我似乎无法让滚动条适用于页面上的所有对象。 我已将所有对象设置为小于定义的滚动条区域。然而,当我滚动时,我永远不会超出物体的末端。 如何让单个滚动条语句适用于屏幕上的所有对象? 我需要运行某种 JavaScript 来调用 Web 浏览器本身的滚动条功能吗?
<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
body
{
}
</style>
</head>
<body style = "height: 3000px; width: 3000px; border: 1px solid; overflow: auto;">
<div id = "Line1Main" style = "position:fixed; top: 290px; left: 25px; width: 2000px; height: 1px; transform: rotate(0deg); border-bottom: 1px solid black;"></div>
<div id = "Line1Main1" style = "position:fixed; top: 270px; left: 25px; width: 2000px; height: 1px; transform: rotate(0deg); border-bottom: 1px solid black;"></div>
<div id = "Line1Main2" style = "position:fixed; top: 250px; left: 25px; width: 2000px; height: 1px; transform: rotate(0deg); border-bottom: 1px solid black;"></div>
<div id = "Line1Main" style = "position:fixed; top: 1030px; left: 30px; width: 2000px; height: 1px; transform: rotate(90deg); border-bottom: 1px solid black;"></div>
<div id = "Line1Main1" style = "position:fixed; top: 1030px; left: 60px; width: 2000px; height: 1px; transform: rotate(90deg); border-bottom: 1px solid black;"></div>
<div id = "Line1Main2" style = "position:fixed; top: 1030px; left: 90px; width: 2000px; height: 1px; transform: rotate(90deg); border-bottom: 1px solid black;"></div>
<script>
</script>
</body>
</html>
我尝试在页面的样式、正文部分粘贴类似的代码 - 这不起作用 - 它似乎只是将滚动条区域应用到标题。 我也尝试过javascript:scrollbars.visible=true
必须更换位置:固定;与位置:相对; 谢谢你@mplungjan