gpt4 book ai didi

css - 修复网页中的水平滚动

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

I am currently working on a side project and i ran into something annoying: When my browser size is smaller than around (1280 | something) the content is not entirely viewable. I can scroll to the right to see whats there, but not to the left.

html:

<div id="wrapper">
[...]
</div>

CSS:

#wrapper {
position: absolute;
width: 1200px;
margin-right: -600px;
}

最佳答案

你的居中技术是错误的。

使用:

#wrapper {
margin-left:auto;
margin-right:auto;
width: 1200px;
}

此外,对布局使用绝对定位通常不是一个好主意。了解如何使用 float ,并摆脱 TABLE。

关于css - 修复网页中的水平滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7814262/

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