Remove the dotted border that appears when a hyperlink or button is clicked

Source: Internet
Author: User
From the code above, we can see that we can solve this problem by setting the CSS attribute outline. FF has a bug. The input and button labels are specially handled by the private attribute:-moz-focus-inner.

Remove the dotted border when a hyperlink or button is clicked in pure CSS

A, input, button {outline: none; }::-moz-focus-inner {border: 0px;} WEB Front-end Developer Network front-end attacker www.web92.net Www.web92.net

从以上代码可以看出,可以通过设置CSS属性outline解决。

FF存在bug,其中input,button标签通过私有属性::-moz-focus-inner特别处理

以上方法在IE6、IE7下无效。可使用 onfocus 属性解决,如下:

admin10000.com

使用jquery方法只需一句,非常简单,支持所有浏览器

$(“a,input,button”).focus(function(){this.blur()});

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.