CSS removes the default outline outer box and css outer box of the browser.

Source: Internet
Author: User

CSS removes the default outline outer box and css outer box of the browser.

By default, When you click tag a, input, or add a click event, the browser leaves a contour box (blue under chrome )~ However, these default profile boxes sometimes affect the appearance and are not what we want to retain. How should we eliminate these annoying contour boxes?

Use outline: none to remove the outline Outer Frame

For example:

a{ outline:none; }

The profile box on the PC end disappears, but it still exists on the mobile phone ~~

Add the following code.

a{     outline:none;      -webkit-tap-highlight-color:rgba(0,0,0,0);}

 

-Webkit-tap-highlight-color is an unsupported WebKit property that does not appear in the CSS specification draft.

When a user clicks a link in iOS Safari or a JavaScript clickable element, the highlighted color is overwritten.

This attribute can only set transparency. If no transparency is set, iOS Safari uses the default transparency. When the transparency is set to 0, this attribute is disabled. When the transparency is set to 1, the elements are invisible when you click.

Syntax:

-Webkit-tap-highlight-color: Color

Default Value: Inherit

Applicable: Link elements such as opening a new window, img elements such as saving images, etc.

Valid value:
Color: color value
Transparent: transparent Value

* Descriptions of newly added attributes in CSS3 may be incorrect and changed. This attribute is for reference only and is continuously updated.

Compatibility:
  • Available for iOS 1.1.1 and later Safari browsers
  • Most android phones also support this function, but the display effect is different.

PS: This 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.