溢出到固定 div 内的下一行?

发布于 2024-11-28 14:34:55 字数 505 浏览 8 评论 0原文

我有一个固定的div,里面有一个ul。固定div设置为overflow-x:hidden;overflow-y:scroll;,每个li设置为float:left; 。当一行中的 li 太多而无法查看时,我希望它们溢出到下一行,但它会继续沿直线延伸到无穷大,而不会中断到下一行。 lis 由 JavaScript 脚本生成。

以下是该页面的链接: http://hypotheticalmeraki.doubleohnine.com

编辑:在左下角,有一个向上的箭头,当你点击它时,固定的 div 就会出现。其中的图像各为一里。

非常感谢

问题已解决 将 ul 设置为固定宽度(使其非常重要)并设置overflow-x:hidden;和overflow-y:scroll;。

I have a fixed div with a ul inside of it. The fixed div is set to overflow-x: hidden; and overflow-y: scroll;, each li is set to float: left;. When there are too many li to view in a line, I want them to overflow to the next line, but it continues in a straight line to infinity, never breaking into the next line. The lis are generated by a JavaScript script.

Here is the link to the page: http://hypotheticalmeraki.doubleohnine.com

Edit: on the bottom left, there's an up arrow, when you click that, the fixed div comes up. The images in that are each an li.

Thank you so much

Issue Fixed
Made the ul a fixed width (made it !important) and set overflow-x: hidden; and overflow-y: scroll;.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梓梦 2024-12-05 14:34:55

试试这个

<div1> <- fixed, overflow
<div2> <- position relative
<ul><li>
</div2>
</div1>

try this

<div1> <- fixed, overflow
<div2> <- position relative
<ul><li>
</div2>
</div1>
下壹個目標 2024-12-05 14:34:55

使用 overflow: auto; 而不是使用 overflow-x:hiddenoverflow-y:scroll

Use overflow: auto; instead of using overflow-x: hidden and overflow-y: scroll

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文