我需要更改CSS中禁用的输入元素的样式。
<input type="text" class="details-dialog" disabled="disabled" />
如何在Internet Explorer中执行此操作?
发布于 2011-05-31 19:42:47
您可以:
input[type="text"][disabled] {
color: red;
}
发布于 2011-08-17 12:19:18
下面的代码让您在IE8中非常接近,也可以在其他浏览器中使用。
在您的html中:
<input type="text"
readonly="readonly" <!-- disallow editting -->
onfocus="this.blur();" <!-- prevent focus -->
tabindex="-1" <!-- disallow tabbing -->
class="disabledInput" <!-- change the color with CSS -->
/>
在你的CSS中:
.disabledInput {
color: black;
}
在IE8中,悬停时会有轻微的边框颜色变化。一些用于input.disabledInput:hover的CSS可能会解决这个问题。
发布于 2012-07-12 22:41:32
input[disabled], input[disabled]:hover { background-color:#444; }
https://stackoverflow.com/questions/6186989
复制相似问题