html - 从下到上渲染 <ul> 元素

标签 html css render html-lists direction

我有一个带有可变元素计数的 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 的东西,不幸的是它不存在。

最佳答案

ul, ul li {
-webkit-transform: scaleY(-1);
   -moz-transform: scaleY(-1);
    -ms-transform: scaleY(-1);
     -o-transform: scaleY(-1);
        transform: scaleY(-1);

}
ul {
    width: 350px;
}
 li {
    display: inline-block;
    width: 70px;
    zoom: 1;         
    *display: inline;
}

来源:Bottom to top <ul> element arrangement

关于html - 从下到上渲染 <ul> 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8667271/

相关文章:

html - 垂直调整大小时 Div 重叠

iphone - iPhone 和 Mac/PC 上 html 表格的字体大小不同

html - 基于div的html页面设计

css - 水平对齐 HTML 标题元素

javascript - Reactjs 将动态组件添加到其他组件中

html - 使用 CSS 在我的网站边缘添加灰色边框

html - 更改 Mvc TextboxFor 的字体大小

html - MVC/ Razor : Conditional nested html tag

list - 如何在榆树中呈现列表?

javascript - 谷歌浏览器中非常奇怪的渲染行为