?
This document uses PHP Chinese website manual Release
order:<integer>
默認(rèn)值:0
適用于:flex子項和flex容器中的絕對定位子元素
繼承性:無
動畫性:是
計算值:指定值
<integer>:用整數(shù)值來定義排列順序,數(shù)值小的排在前面。可以為負(fù)值。
order定義將會影響 <' position '> 值為static
元素的層疊級別,數(shù)值小的會被數(shù)值大的蓋住。
demo:
.test { display: flex; } .item2 { order: -1; margin: -30px; } <div class="test"> <p class="item1">flex item1</p> <p class="item2">flex item2</p> </div>
此時,item1將會蓋在item2之上
對應(yīng)的腳本特性為order。
Values | IE | Firefox | Chrome | Safari | Opera | iOS Safari | Android Browser | Android Chrome |
---|---|---|---|---|---|---|---|---|
Basic Support | 6.0-10.0 | 2.0-21.0 | 4.0-20.0 | 6.0 | 15.0+-webkit- | 6.0-6.1 | 2.1-4.3 | 18.0-19.0 |
11.0+ | 22.0+ | 21.0+-webkit- | 6.1+-webkit- | 17.0+ | 7.0+-webkit- | 4.4+ | 20.0+-webkit- | |
29.0+ | 9.0+ | 9.0+ | 28.0+ |
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>order_CSS參考手冊_web前端開發(fā)參考手冊系列</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" /> <style> h1{font:bold 20px/1.5 georgia,simsun,sans-serif;} .box{ display:-webkit-flex; display:flex; margin:0;padding:10px;list-style:none;background-color:#eee;} .box li{width:100px;height:100px;border:1px solid #aaa;text-align:center;} #box li:nth-child(3){ -webkit-order:-1; order:-1; } </style> </head> <body> <h1>order示例:</h1> <ul id="box" class="box"> <li>a</li> <li>b</li> <li>c</li> <li>d</li> <li>e</li> </ul> </body> </html>
點擊 "運行實例" 按鈕查看在線實例