语法:

outline-offset<length> | inherit

相关属性:outline , outline-width , outline-style , outline-color

取值:

<length>
定义轮廓距离容器的值。
inherit:
默认继承。

说明:

outline-offset 可以让轮廓偏离容器边缘,即可以调整外框与容器边缘的距离。参见outline属性。

兼容性:

类型 IEInternet Explorer FirefoxFirefox ChromeChrome OperaOpera SafariSafari
版本 (×)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-offset</title>
</head>
<body>
<div style="width: 160px;padding: 10px;height: 30px;border: 2px solid black;outline-color:#897048;outline-style:solid;outline-width:2px;outline-offset: 5px;">这绘制的是一个轮廓边框</div>
</body>
</html>
 

快速跳转