如何防止水平列表中断? [英] how can one prevent a horizontal list from breaking?

查看:71
本文介绍了如何防止水平列表中断?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在寻找一种方法来防止水平的内联无序列表一旦包含在具有特定宽度(短于列表)的元素内,就会分成单独的行。该元素具有溢出。设置为隐藏。


我发现创造该效果的唯一方法是给UL特定的宽度。元素,但现在,我必须为宽度未知的列表创建该效果! (用户可以将项目添加到列表中)。还有其他方法吗?它会对我有所帮助!!


谢谢大家

Hi all, i am looking for a way to prevent a horizontal, inline unordered list from breaking into seperate lines once contained inside a element with specific width (shorter than the list). the element has "overflow" set to "hidden".

the only way i found to create that effect is by giving a specific width to the "UL" element but now, i have to create that effect for a list with unknown width!! (user can add items to list). is there any other way? it would help me so much!!

thank you all

推荐答案

你能给出一些例子(缩短)您当前的HTML和CSS的代码?如果您认为它会有所帮助,也会截取屏幕截图。
Can you give an example of some (shortened) code of you current HTML and CSS? Also a screenshot if you think it would help.


我会尝试发布一个示例页面的链接,但同时考虑这个代码:

HTML:
i will try to post a link to an example page but consider this code in the meanwhile:
HTML:
展开 | 选择 | Wrap | 行号


如果给#container一个高度,溢出将被隐藏。
If you give #container a height and overflow will be hidden.


这篇关于如何防止水平列表中断?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆