语法:

border-radiusnone | <length>{1,4} [ / <length>{1,4} ]?

相关属性: border-top-right-radius , border-bottom-right-radius , border-bottom-left-radius , border-top-left-radius

取值:

<length>
由浮点数字和单位标识符组成的长度值。不可为负值。
border-top-left-radius:
由浮点数字和单位标识符组成的长度值。不可为负值。

说明:

  1. 第一个值是水平半径。
  2. 如果第二个值省略,则它等于第一个值,这时这个角就是一个四分之一圆角。
  3. 如果任意一个值为0,则这个角是矩形,不会是圆的。
  4. 值不允许是负值。
引擎类型 Gecko Webkit Presto
Border-radius -moz-border-radius -webkit-border-radius  
border-bottom-left-radius -moz-border-radius-bottomleft -webkit-border-bottom-left-radius
border-bottom-right-radius -moz-border-radius-bottomright -webkit-border-bottom-right-radius
border-top-left-radius -moz-border-radius-topleft -webkit-border-top-left-radius
border-top-right-radius -moz-border-radius-topright -webkit-border-top-right-radius

兼容性:

类型 IEInternet Explorer FirefoxFirefox ChromeChrome OperaOpera SafariSafari
版本 (×)IE6 (×)Firefox 2.0 (√)Chrome 1.0.x (×)Opera 9.64 (√)Safari 3.1
(×)IE7 (√)Firefox 3.0 (√)Chrome 2.0.x  
(×)IE8 (√)Firefox 3.5

示例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="utf-8" />
<meta name="robots" content="all" />
<meta name="author" content="Tencent-ISRD" />
<meta name="Copyright" content="Tencent" />
<title>Border-radius</title>
</head>
<body>
<div style="border-width: 1px;border-style: solid;-moz-border-radius: 11px;-khtml-border-radius: 11px;-webkit-border-radius: 11px;border-radius: 11px;padding:5px;">在Firefox和Safari 3的浏览器里能看到圆角效果</div>
</body>
</html>
 

快速跳转