CSS remove a label (link) Dashed box method

Source: Internet
Author: User

When a link gets the focus, the default is a dotted box. As shown in figure:

In Firefox can use-moz-outline:none; or Outline:none; To remove it. So we can write this:

code is as follows: A:focus {


Outline:none;


-moz-outline:none;


}


By the way, if you've ever used Safari and Chrome, you might find that the border appears shaded when the input box has the focus.

You can also use the Outline property if you want to remove the shadow effect.

code is as follows: Input,textarea {


Outline:none;


}


To be honest, just say is Firefox, now say IE. First of all, I regret that we have not found a better solution to remove IE link dotted box by CSS. So there's only one alternative, the Hidefocus attribute of the A tag (this property is unique to IE).

code as follows: <a href= "#" hidefocus= "true" > Links </a>


Note: JS script corresponding to the property name is: Hidefocus. The corresponding JS code should be:

code is as follows: Xxx.hidefocus = "true";


There is also a method that is not recommended. is to lose focus when the link gets the focus.



The
code is as follows: <a href= "#" onfocus= "This.blur ();" > Links </a>


This approach works, but it's too violent to use.

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.