Solution for setting the border: none attribute of the button in IE is invalid

Source: Internet
Author: User

Solution for setting the border: none attribute of the button in IE is invalid

This article describes the solution for setting the border: none attribute in IEAs invalid. The following two methods are provided, which can be used as a reference.

When setting a borderless element, you only need to set border: none for the element. Of course, setting border: 0 has the same effect, but actually there is a performance difference between the two.

The Code is as follows:

Border: none: The border is set to none without any processing;

Border: 0: The border width is set to 0 pixels, but the border-color and border-style are still rendered.

 

However, in IE, this is true for the button and input elements. In IE6, 7, border: none is only equivalent to border-style: none, while the border space is still in place. This leads to inconsistent width and height of input adjustment in various browsers! In IE6, 7, although border: none is set, the border still exists. Do not believe it.

The solution is as follows:

Method 1:

The Code is as follows:

Border: 0 none;

 

Method 2:

Add a background color to the button.

Copy the Code as follows:

Button {

Background: # fff;

}

 

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.