?
Dieses Dokument verwendet PHP-Handbuch für chinesische Websites Freigeben
border-radius:[ <length> | <percentage> ]{1,4} [ / [ <length> | <percentage> ]{1,4} ]?
默認值:看每個獨立屬性
適用于:所有元素
繼承性:無
動畫性:看每個獨立屬性
計算值:看每個獨立屬性
<length>:
用長度值設置對象的圓角半徑長度。不允許負值
<percentage>:
用百分比設置對象的圓角半徑長度。不允許負值
水平半徑:如果提供全部四個參數(shù)值,將按上左(top-left)、上右(top-right)、下右(bottom-right)、下左(bottom-left)的順序作用于四個角。
如果只提供一個,將用于全部的于四個角。
如果提供兩個,第一個用于上左(top-left)、下右(bottom-right),第二個用于上右(top-right)、下左(bottom-left)。
如果提供三個,第一個用于上左(top-left),第二個用于上右(top-right)、下左(bottom-left),第三個用于下右(bottom-right)。
垂直半徑也遵循以上4點。
對應的腳本特性為borderRadius。
淺綠 = 支持
紅色 = 不支持
粉色 = 部分支持
Values | IE | Firefox | Chrome | Safari | Opera | iOS Safari | Android Browser | Android Chrome |
---|---|---|---|---|---|---|---|---|
Basic Support | 6.0-8.0 | 2.0-12.0 -moz- #1 | 4.0-43.0 -webkit- | 3.1-8.1 -webkit- | 10.5-28.0 -webkit- | 3.2-8.1 -webkit- | 2.1-4.4.4 -webkit- | 18.0-40.0 -webkit- |
9.0+ | 4.0+ | 5.0+ | 5.0+ | 10.5+ | 4.0+ | 2.2+ | 18.0+ | |
<percentage> | 9.0+ | 4.0+ | 5.0+ | 5.0+ | 10.5+ | 4.0+ | 2.1-2.3 | 18.0+ |
3.0+ |
Firefox從13.0開始移除對-moz-的支持,僅支持標準的border-radius寫法,在4.0-12.0區(qū)間,兩種方式都支持。
早期的Chrome和Safari不支持border-radius取值為<percentage>。
<!DOCTYPE html> <html lang="zh-cmn-Hans"> <head> <meta charset="utf-8" /> <title>border-radius_CSS參考手冊_web前端開發(fā)參考手冊系列</title> <meta name="author" content="Joy Du(飄零霧雨), dooyoe@gmail.com, www.doyoe.com" /> <style> ul{margin:0;padding:0;} li{list-style:none;margin:10px 0 0 0;padding:10px;background:#bbb;} .test .one{border-radius:10px;} .test .two{border-radius:10px 20px;} .test .three{border-radius:10px 20px 30px;} .test .four{border-radius:10px 20px 30px 40px;} .test2 .one{border-radius:10px/5px;} .test2 .two{border-radius:10px 20px/5px 10px;} .test2 .three{border-radius:10px 20px 30px/5px 10px 15px;} .test2 .four{border-radius:10px 20px 30px 40px/5px 10px 15px 20px;} </style> </head> <body> <h2>水平與垂直半徑相同時:</h2> <ul class="test"> <li class="one">提供1個參數(shù)<br />border-radius:10px;</li> <li class="two">提供2個參數(shù)<br />border-radius:10px 20px;</li> <li class="three">提供3個參數(shù)<br />border-radius:10px 20px 30px;</li> <li class="four">提供4個參數(shù)<br />border-radius:10px 20px 30px 40px;</li> </ul> <h2>水平與垂直半徑不同時:</h2> <ul class="test2"> <li class="one">提供1個參數(shù)<br />border-radius:10px/5px;</li> <li class="two">提供2個參數(shù)<br />border-radius:10px 20px/5px 10px;</li> <li class="three">提供3個參數(shù)<br />border-radius:10px 20px 30px/5px 10px 15px;</li> <li class="four">提供4個參數(shù)<br />border-radius:10px 20px 30px 40px/5px 10px 15px 20px;</li> </ul> </body> </html>
點擊 "運行實例" 按鈕查看在線實例