Home > Web Front-end > JS Tutorial > Three ways to remove the dotted box of IE links using JS CSS_Basic knowledge

Three ways to remove the dotted box of IE links using JS CSS_Basic knowledge

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:15:16
Original
1231 people have browsed it

Method 1: Use the onfocus event of javascript to implement as follows:
Html code

Copy code The code is as follows:

If you introduce the jQuery framework, you can use its event binding mechanism:
Js code
Copy code The code is as follows:

$('a').bind('focus', function(){
if(this.blur){ //If this is supported. blur
this.blur();
}
});


Method 2: Use css style to implement the following :
Css code
Copy code The code is as follows:

a{
blr: expression( this.onFocus=this.close());
} /* Only supports IE, excessive use is inefficient*/
a{
blr: expression(this.onFocus=this.blur()) ;
} /* Only supports IE, excessive use is inefficient*/
a:focus {
-moz-outline-style: none;
} /* IE does not support*/
:focus {
outline: none;
} /* for Firefox */


Method 3: Use tag attributes, only supports IE, the implementation is as follows: Html code
Copy code The code is as follows:

Method 4: HTC implementation is as follows:
Save the following code as .htc Suffixed file
Js code
Copy code The code is as follows:




CSS code
Copy code The code is as follows:

a {behavior:url("htc file")}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template