Three methods to remove IE-linked dashed frames using JSCSS _ basic knowledge

Source: Internet
Author: User
This article uses JS, CSS, label attributes, and other methods to remove the dotted line boxes on IE links. The method is very simple and you can choose to use Method 1: Use the javascript onfocus eventThe implementation is as follows:
Html code

The Code is as follows:


Design Honeycomb


If the jQuery framework is introduced, you can use its event binding mechanism:
Js Code

The 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

The 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

The Code is as follows:


Design Honeycomb


Method 4: HTC implements the following:
Save the code as a. htc extension file.
Js Code

The Code is as follows:



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.