outline-offset 属性对轮廓进行偏移,并在边框边缘进行绘制。
outline-offset: length|inherit;
| 值 | 描述 |
|---|---|
| length | 轮廓与边框边缘的距离。 |
| inherit | 规定应从父元素继承 outline-offset 属性的值。 |
HTML
<div class="stage">这个 div 在边框边缘之外 15 像素处有一个轮廓。</div>
CSS
.stage{
margin:20px;
width:150px;
padding:10px;
height:70px;
border:2px solid black;
outline:2px solid red;
outline-offset:15px;
}
执行结果