CSS remove the dotted box after clicking on the a tag (go from the network)

Source: Internet
Author: User

Outline is a property of CSS3 and is seldom used.

Declaration, this is not compatible with CSS properties, IE6, IE7, roaming browser is not compatible.

What is the outline control?

When focusing on a tag, there will be a dashed box around the area of the a tag, which is different from border, which does not occupy any width. When you cancel the focus, the dashed box disappears naturally. You can see it through a few versions of surfing, Firefox or IE. Safari, Opera, Goole browser and so on itself does not support this effect, so do not see.

This is a label is focused after the appearance of the dotted box, that is, outline;

Basically this is useless effect, in most cases we would like to not have this effect, so give a tag set outline:none; Unfortunately, IE6, 7 and the browser can not be implemented, only FF,IE8 in the outline: None will then cancel the focused dashed box. So I say this outline attribute is basically a fee attribute.

How can I cancel this dashed box? There are three common methods:

1: Add JS control in a tag, when the A tag is focused, force cancel focus, this time a tag naturally will not have a dashed box.

<a href= "#" onfocus= "This.blur ();" > Testing </a>
The blur () is triggered when the focus is set, and the focus is forced to cancel. Nature is a proven one.

2: In a tag nested other tags, such as span or VAR, etc., put the content in the nested tag. At this point, click on the link, the focus is a sub-tag, nature will not focus on a tag, so can also avoid this problem.

3: Do not apply a tag to do the link, using other tags, using JS to make hover effect, add Cursour:pointer in the CSS, set the mouse over the time-varying small hands. To the user is the illusion of the link. Use JS to do a click on the page jump and so on. The biggest drawback is that se-friendliness is much more tanesashi than the first two.

The common denominator of these three methods is more troublesome, compared to the first, the second third also depends on different circumstances. It will be used, too.

I think outline this effect when the browser will be canceled sooner or later, so the knowledge about this attribute is also quite chicken.

Or you can add the body a{outline:none;blr:expression (This.onfocus=this.blur ()) to the CSS;}

CSS remove the dotted box after clicking on the a tag (go from the network)

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.