2016-12-30 62 views
-4

我怎樣才能使與此相反的列表項使用CSS只如何使用升序和降序僅使用HTML和CSS而不是Jquery?

<ul> 
    <li>List 1</li> 
    <li>List 2</li> 
    <li>List 3</li> 
    <li>List 4</li> 
    <li>List 5</li> 
</ul> 
+0

你能否就此展開?你想扭轉一個數字列表嗎?或者你想分類嗎?或者是什麼? –

+1

[http://stackoverflow.com/questions/25695000/how-to-display-a-reverse-ordered-list-in-html](http://stackoverflow.com/questions/25695000/how-to-display -a-reverse-ordered-list-in-html) –

+1

HTML和CSS純粹是靜態UI呈現格式。它們與訂購完全無關。如果您純粹擁有HTML和CSS,請使用「Ctrl + X」和「Ctrl + V」來訂購HTML代碼? – SOFe

回答

1

@Vipul Nayee請檢查下面的代碼。

ul#top-to-bottom { 
 
    position: absolute; 
 
    width:50px; 
 
    text-align: left; 
 
    float: left; 
 
    -webkit-transform: scaleY(-1); 
 
    transform: scaleY(-1); 
 
} 
 
ul#top-to-bottom > li { 
 
    width: 50px; 
 
    height: 50px; 
 
    position: relative; 
 
    float: right; 
 
    display: block; 
 
    -webkit-transform: scaleY(-1); 
 
    transform: scaleY(-1); 
 
} 
 
li#a { 
 
    background:blue; 
 
} 
 
li#b { 
 
    background:red; 
 
} 
 
li#c { 
 
    background:purple; 
 
} 
 
li#d { 
 
    background:green; 
 
}
<ul id="top-to-bottom"> 
 
    <li id="a">List 1</li> 
 
    <li id="b">List 2</li> 
 
    <li id="c">List 3</li> 
 
    <li id="d">List 4</li> 
 
</ul>

相關問題