Home >Web Front-end >CSS Tutorial >Solution to invalid button setting border:none attribute in IE_Basic Tutorial

Solution to invalid button setting border:none attribute in IE_Basic Tutorial

WBOY
WBOYOriginal
2016-05-16 12:03:523198browse

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

Copy code span> The code is as follows:

border:none: The border is set to none, no processing is done;
border:0: The border width is set is 0 pixels, but border-color and border-style are actually being rendered.

However, in IE, this is not the case for button and input elements. In IE6 and 7, border:none is only equivalent to border-style:none, and the space occupied by the border is still Here I am. This causes the width and height of the input to be adjusted inconsistently across browsers! In IE6 and 7, although border:none is set, the border still exists. If you don’t believe me, give it a try.
The solution is given below:
The first method:
Copy code The code is as follows:

border:0 none;

Second method:
Add a background color to the button
Copy code The code is as follows:

button{
background:#fff;
}
Statement:
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