"CSS" a:hover setting the upper and lower borders to expire under IE6 and IE7

Source: Internet
Author: User

Some time ago in the writing style of the time to find this problem, although the resolution of the bug is still recorded, so as not to appear again such a problem.

Demo Code:

<!DOCTYPE HTML><HTMLLang= "en"><Head>    <MetaCharSet= "UTF-8"/>    <Metahttp-equiv= "X-ua-compatible"content= "Ie=edge,chrome=1"/>    <Metaname= "Renderer"content= "WebKit"/>    <Metaname= "keywords"content=""/>    <Metaname= "description"content=""/>    <title>A:hover setting the upper and lower borders to expire under IE6 and IE7</title>    <style>a{text-decoration:None;}a:hover{Color:#f00;Border:2px Solid Orange;}    </style></Head><Body>    <ahref= "javascript:;">A:hover setting the upper and lower borders to expire under IE6 and IE7</a></Body></HTML>

Through the demo we can find that in IE6 and IE7 browser, the mouse cursor up and down the border does not show only the left and right border display, and other browsers are normal display, why?

Because the a tag Haslayout property is false in IE6 and IE7, what is Haslayout? Please Baidu, here I will not say more.

Since know is haslayout problem, then only need to set up haslayout on the line, set up a lot of methods, the following list of commonly used 2 ways:

a:hover {position:relative;} a:hover {Zoom:1;}

Ps:

IE under 80% bugs are caused by the element is not haslayout, so if you encounter difficult to explain the problem in IE, the first thing to do is to add haslayout to the element.

"CSS" a:hover setting the upper and lower borders to expire under IE6 and IE7

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.