我不想调整或缩放任何东西,我只希望内容保持在相同的位置,相同的大小,并允许在较小的屏幕上水平滚动。默认情况下,水平滚动是允许的,但一切都会乱七八糟。我是一个新手,但我仍然认为有一个简单的解决方案。我用像素来定位我所有的元素,也许我应该用百分比来代替?有没有人能开导我!
发布于 2021-01-29 19:53:28
您可以尝试使用类似以下内容:
.scrolls {
overflow-x: scroll;
overflow-y: hidden;
height: 80px;
white-space:nowrap
}你可以在w3school上找到更多信息。
示例:
div.ex1 {
background-color: lightblue;
width: 50px;
overflow-x: scroll;
}<!DOCTYPE html>
<html>
<body>
<h1>The overflow-x Property</h1>
<h2>overflow-x: scroll:</h2>
<div class="ex1">Lorem ipsum dolor sit amet, consectetuer adipiscing elit...</div>
</body>
</html>
https://stackoverflow.com/questions/65953902
复制相似问题