?
本文檔使用
php中文網(wǎng)手冊 發(fā)布
flex-basis:<length> | <percentage> | auto | content
默認(rèn)值:auto
適用于:flex子項
繼承性:無
動畫性:是,當(dāng)值為非關(guān)鍵字時
計算值:指定值
<length>:用長度值來定義寬度。不允許負(fù)值
<percentage>:用百分比來定義寬度。不允許負(fù)值
auto:無特定寬度值,取決于其它屬性值
content:基于內(nèi)容自動計算寬度
如果所有子元素的基準(zhǔn)值之和大于剩余空間,則會根據(jù)每項設(shè)置的基準(zhǔn)值,按比率伸縮剩余空間
對應(yīng)的腳本特性為flexBasis。
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+ | |||||
content | 6.0-11.0 | 2.0-42.0 | 4.0-47.0 | 6.0-9.0 | 15.0-32.0 | 6.0-9.0 | 2.1-4.4.4 | 18.0-42.0 |
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>flex-basis_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; width:600px;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-flex-basis:600px; flex-basis:600px; } </style> </head> <body> <h1>flex-basis示例:</h1> <ul id="box" class="box"> <li>a</li> <li>b</li> <li>c</li> <li>d</li> <li>e</li> </ul> </body> </html>
點擊 "運行實例" 按鈕查看在線實例