outline-width
试试看
在定义轮廓外观时,使用简写属性 outline
通常更方便。
语法
css
/* Keyword values */
outline-width: thin;
outline-width: medium;
outline-width: thick;
/* <length> values */
outline-width: 1px;
outline-width: 0.1em;
/* Global values */
outline-width: inherit;
outline-width: initial;
outline-width: revert;
outline-width: revert-layer;
outline-width: unset;
outline-width
属性指定为以下列出的任何一个值。
值
正式定义
正式语法
outline-width =
<line-width>
<line-width> =
<length [0,∞]> |
thin |
medium |
thick
示例
设置元素的轮廓宽度
HTML
html
<span id="thin">thin</span>
<span id="medium">medium</span>
<span id="thick">thick</span>
<span id="twopixels">2px</span>
<span id="oneex">1ex</span>
<span id="em">1.2em</span>
CSS
css
span {
outline-style: solid;
display: inline-block;
margin: 20px;
}
#thin {
outline-width: thin;
}
#medium {
outline-width: medium;
}
#thick {
outline-width: thick;
}
#twopixels {
outline-width: 2px;
}
#oneex {
outline-width: 1ex;
}
#em {
outline-width: 1.2em;
}
结果
规范
规范 |
---|
CSS 基本用户界面模块级别 4 # outline-width |
浏览器兼容性
BCD 表格仅在浏览器中加载