A dashed border that appears when you remove a hyperlink or button click

Source: Internet
Author: User
In the front-end production process will find that some text/image links, or some input control, when clicked will appear around the dotted border, generally in Firefox and IE browser appear dotted box, Google will not have.

These dashed borders are used as an aid to the visual design, and when the Keyboard tab is used to navigate the page without using the mouse, the location of the current link or control is marked for easy navigation. This is even more essential for those who are visually impaired.

But sometimes we do not want to use them, because the browser to the dashed box parsing is different, and irregular, so in the visual design has become some kind of defect. So at such times, we want to disable these dashed borders so that the visual enjoyment of the visitors is flawless.

A dotted border that appears when you remove a hyperlink or a button click on a pure CSS

<style type= "Text/css" >a,input,button{outline:none;}::-moz-focus-inner{border:0px;} </style>

As you can see from the above code, you can resolve this by setting the CSS properties outline.

FF has a bug where the Input,button tag is handled by private attributes::-moz-focus-inner Special handling

The above method is invalid under IE6 and IE7. You can use the Onfocus property to resolve the following:

<a href= "http://www.admin10000.com" target= "_blank" onfocus= "This.blur ()" >admin10000.com</a>

Using the jquery method, it's simple, it's easy to support all browsers

$ ("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.