如何在IE8中禁用textarea样式? [英] How do you style disabled textarea in IE8?

查看:307
本文介绍了如何在IE8中禁用textarea样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您需要在IE8中启用禁用元素样式的规则吗?我现在有代码。它在IE7下工作正常,但在IE8上不工作。 IE8只给我plaint wihte背景。为什么?

What rule do you need to enable styling of disabled elements in IE8? I have the code below now. It that works fine under IE7, but not on IE8. IE8 just give me plaint wihte background. Why?

input[disabled], input:disabled, textarea[disabled], textarea[disabled="disabled"], textarea:disabled {
    background:#EBEBE4;
}


推荐答案

选择器跳闸IE8!



如果您必须使用这些CSS3,您必须取消组合这些选择器 伪类 ;

the :pseudo class in the selector is tripping up IE8!

you have to ungroup these selectors if you absolutely have to use those CSS3 pseudo classes;

如果在规则集中有一个选择器,IE8不理解它忽略了整个事情 - 这在IE8中常见的CSS3伪类

If there's a selector in the ruleset that IE8 doesn't understand it's ignoring the whole thing - this is common in IE8 with CSS3 pseudo classes

例如如果你把它们分开,并且删除选择器的伪:disabled 部分,你会看到下面的第一个例子适用于所有,而第二个仍然工作除了IE7

e.g. If you separate them out and remove the pseudo :disabled parts of the selector completely - you'll see the first example below works for all, whereas the second one still works except for IE7

input[disabled], select[disabled], textarea[disabled] {background-color: #0f0;} /* lime green - works in IE7+ and modern browsers */

input[disabled="disabled"], select[disabled="disabled"], textarea[disabled="disabled"] {background-color:#ff0;} /* yellow -  IE8+ and modern browsers */

颜色颜色)问题指出在另一个答案不是你的问题的原因,但它不会帮助,如果你也试图改变颜色);

the color (as opposed to background-color) issue pointed at in another answer is not the cause of your issue, but it wouldn't help if you were also trying to change the color ;)

这篇关于如何在IE8中禁用textarea样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆