Remove the dotted frame of link elements and be compatible with IE7, IE6, and FF_Experience exchange

WBOY
Release: 2016-05-16 12:05:39
Original
1592 people have browsed it

Recommend the following code

Copy code The code is as follows:

a {outline: none; /* for Forefox * / }
a {star:expression(this.onFocus=this.blur()); /* for Ie*/ }

The following code is more troublesome
We use htc files to solve this problem. Save the following code as a link.htc file on the home page.​
Copy code The code is as follows:


<script>    <br>function hscfsy(){    <br>this.blur();    <br>}    <br></script>

Write the following code in the HTML file to create a link:
jb51.net
We start defining the CSS style for this link:

a {
 display:block;
width:100px;
height:30px;
Line-height:30px;
text-align:center;
}
a:hover {
Background:#ddd;
}
CSS styles determine the appearance of links, block elements with a certain width and height. Text is aligned horizontally, left and center.​
We add an attribute to the style of the a tag. Use this to remove the dashed border of a link:

a {
 display:block;
width:100px;
height:30px;
Line-height:30px;
text-align:center;
Behavior:url(line.htc);
}
We run the following code to see the effect:

[Ctrl A Select all Note:If you need to introduce external Js, you need to refresh it to execute]

We previewed it in IE7 and IE6, and there is no problem. But the dashed box still exists in FF.
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!