Three methods to remove IE-link dashed frames using JS CSS

Source: Internet
Author: User

Method 1: Use the javascript onfocus eventThe implementation is as follows:
Html code
Copy codeThe Code is as follows:
<A href = "http://www.jb51.net/" onfocus = "this. blur ();"> Design honeycomb </a>

If the jQuery framework is introduced, you can use its event binding mechanism:
Js Code
Copy codeThe Code is as follows:
$ ('A'). bind ('focal ', function (){
If (this. blur) {// if this. blur is supported
This. blur ();
}
});


Method 2: Use the css style to implement the following::
Css code
Copy codeThe Code is as follows:
A {
Blr: expression (this. onFocus = this. close ());
}/* Only supports IE, Which is inefficient when used too much */
A {
Blr: expression (this. onFocus = this. blur ());
}/* Only supports IE, Which is inefficient when used too much */
A: focus {
-Moz-outline-style: none;
}/* IE does not support */
: Focus {
Outline: none;
}/* For Firefox */


Method 3: using label attributes, only Internet Explorer is supported.: Html code
Copy codeThe Code is as follows:
<A href = "http://www.jb51.net/" hidefocus = "true"> design a beehive </a>

Method 4: HTC implements the following:
Save the code as a. htc extension file.
Js Code
Copy codeThe Code is as follows:
<Public: attach event = "onfocus" onevent = "quit ()"/>
<Script language = "javascript">
Function quit (){
This. blur ();
}
</Script>

CSS code
Copy codeThe Code is as follows:
A {behavior: url ("htc file ")}

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.