问题描述
我正在使用IE11渲染我的一个对话框,因此,连同默认的虚线边框(即焦点按钮的现有样式)一起,无论如何我都可以为outline属性添加一个值,如下所示:
input[type=button]:focus{
outline: 1px solid;
}
以这种方式添加它实际上是替换IE设置的默认轮廓值,所以我只想知道是否可以同时获得两者。
谢谢。
解决方法
轮廓有一定程度的自定义,甚至可以有双边框。
此MDN页面上有一些不错的示例,说明您可以使用的各种样式。
https://developer.mozilla.org/en-US/docs/Web/CSS/outline
<button style="outline: thick double #32a1ce;">Foo</button>
<button style="outline: 8px ridge rgba(170,50,220,.6);">Foo</button>
,
outline
最多可以使用3个与border
类似的属性。
outline-width
outline-style
outline-color
我在所有浏览器中都对其进行了测试,并且看起来工作正常:
input[type=button]:focus{
outline: 8px solid rgba(170,.6);
}
<input type="button" name="submit" value="submit">