语法:
outline-width:<color> | inherit
相关属性:outline , outline-width , outline-style , outline-offset
取值:
- <color>:
- 可以是颜色名 (如 red),rgb 值(如 rgb(255,0,0)) 或十六进制值 (如 #ff0000)。
- inherit:
- 默认继承。执行颜色反转(逆向的颜色)。这么做是为了使边框在不同的背景颜色中都是可见的。
说明:
outline-color 属性设置一个元素整个轮廓中可见部分的颜色。要记住,轮廓的样式不能是 none,否则轮廓不会出现。参见outline属性。
兼容性:
类型 | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
版本 | (×)IE6 | (√)Firefox 3.0.10 | (√)Chrome 2.0.x | (√)Opera 9.64 | (√)Safari 4 |
(×)IE7 | (√)Firefox 3.5 | ||||
(√)IE8 | |||||
示例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://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>outline-color</title> </head> <body> <div style="width: 150px;padding: 10px;height: 30px;border: 2px solid black;outline-color:#FF6600;outline-style:solid;outline-width:2px;outline-offset: 10px;">这绘制的是一个轮廓边框</div> </body> </html>