从下到上渲染<ul>元素

S3M*_*3Mi 6 html css render direction html-lists

我有一个ul可变元素计数.如果li太宽,列表无法在单行处理它们,则会断开该行并开始在较低的行上呈现li,所以我得到这样的结果:

x - 代表列表的元素

| - 代表列表边界,或限制列表宽度的任何内容

|xxxxxxxxx|<- elements reached the end of container and remaining elements will be rendered below
|xxxx     |
Run Code Online (Sandbox Code Playgroud)

我需要的是将元素渲染到底部,这样我才能得到:

|xxxx     |
|xxxxxxxxx|<- elements reached the end of container and remaining elements will be rendered above
Run Code Online (Sandbox Code Playgroud)

可能吗?

这是一些示例代码

<ul>
  <li>Some content</li>
  <li>Other content</li>
  <li>ContentContent</li>
  <li>Zawarto?? Contentu</li>
</ul>
Run Code Online (Sandbox Code Playgroud)

目前,它是无CSS的.我可以添加您建议的任何内容以使其呈现最低顺序.float:bottom遗憾的是,不存在这样的东西.

kon*_*tur 0

您需要使用 JavaScript。如果一条线比您的最大值长,您可以通过尽可能延长较低线的方式将其分割,同时保持低于最大值;虽然很棘手 - 我建议你检查一下付出的努力是否真的值得。