【发布时间】:2011-12-29 11:26:29
【问题描述】:
我有一个 ul 元素计数可变。当 li 太宽以至于列表无法在单行中处理它们时,它会换行并开始在下一行渲染 li,所以我得到这样的结果:
x - 代表列表的元素
| - 代表列表边界,或任何限制列表宽度的东西
|xxxxxxxxx|<- elements reached the end of container and remaining elements will be rendered below
|xxxx |
我需要的是从下到上渲染元素,这样我就可以得到:
|xxxx |
|xxxxxxxxx|<- elements reached the end of container and remaining elements will be rendered above
有可能吗?
这是一些示例代码
<ul>
<li>Some content</li>
<li>Other content</li>
<li>ContentContent</li>
<li>Zawartość Contentu</li>
</ul>
目前,它是无 CSS 的。我可以添加您推荐的任何内容以呈现自下而上的顺序。 float:bottom 之类的东西很遗憾不存在。
【问题讨论】:
-
我想改变自动换行的方式是不可能的。但也许你可以手动添加一些
<br />? -
那我需要知道每个元素的宽度来决定什么时候换行:/.
-
如果您可以使用 javascript,您可以确定必要的宽度。
标签: html css render html-lists direction