通过javascript删除或禁用浏览器的焦点边框 [英] Remove or disable focus border of browser via javascript

查看:112
本文介绍了通过javascript删除或禁用浏览器的焦点边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人将焦点放在tabindex顺序中,有人知道如何禁用或操纵dom元素的虚线边框吗?

Does anybody know how to disable or manipulate the (in most browsers) dashed border of a dom-element if it has the focus in a tabindex order?

I想要为焦点元素构建自己的样式,但是使用现有功能会很棒,因为使用tabindex可以将keydown事件绑定到dom-element。

I want to build my own style for a focused element, but it would be great to use the existing feature, because with tabindex it is possible to bind keydown event to the dom-element.

推荐答案

只需为想要的元素创建CSS规则,这些元素具有 outline:none;

Just make a CSS rule for the elements you want that have outline:none;

这篇关于通过javascript删除或禁用浏览器的焦点边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆