Border: none works in IE8 but not IE7?

对着背影说爱祢 提交于 2019-12-10 11:48:19

问题


I have text inputs with 1px padding that I sometimes put 1 px borders on. I want all text inputs to fill the same vertical space, borders or not. To achieve that, I created a "don't have borders, but fill space like you do" class with border: none and 2px of padding:

.BorderInputNone {
 border: none;
 padding: 2px;
}

This worked in IE8, but in IE7, there were visible borders around the input.

EDIT: I fixed it by using border: transparent.

.BorderInputNone {
border: 1px solid transparent;
padding: 1px;
}

回答1:


Use border: 0px; as it seems more cross browser compatible.

Check this question here question here

Here is an example for you to fix IE7:

http://jsfiddle.net/Z7Uee/




回答2:


I fixed it by using border: transparent.

.BorderInputNone {
border: 1px solid transparent;
padding: 1px;
}


来源:https://stackoverflow.com/questions/10538111/border-none-works-in-ie8-but-not-ie7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!