开发者

How to use the native browser outline in CSS?

开发者 https://www.devze.com 2023-04-13 01:07 出处:网络
When focusing an input field Chrome and Safari show an outline that can be removed via CSS: outline: none;.

When focusing an input field Chrome and Safari show an outline that can be removed via CSS: outline: none;.

I want to display this outline at so开发者_如何学运维me other parts to improve usability. Is there a way to use the native browser outline? I only found out how to display a custom one.


You need to check out for each browser (via Inspector, F12, or Firebug) what the default setting is. For example in Chrome it is

:focus {
    outline: 5px auto -webkit-focus-ring-color;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号