Css属性选择器输入在IE8不工作 [英] Css attribute selector for inputs not working in IE8
问题描述
我有以下css代码在Firefox / Chrome中可用,但在IE8中不可用
I have the following css code working in Firefox/Chrome but not in IE8
input[type='text']
{
float: right;
width: 170px;
}
如果我删除属性选择器,它在IE中工作,但它适用于所有我不想要的输入。
If I remove the attribute selector, it works in IE but it applies to all the inputs, which I dont want.
input
{
float: right;
width: 170px;
}
我认为属性选择器是在IE8支持的,所以我不知道什么问题是。
这不是输入中的代码问题,从我使用属性选择器的那一刻开始,css规则将不能在任何代码内部工作。
I thought attribute selectors were supported in IE8, so I don't know what the problem is. It is not a matter of the code inside the input, from the moment I use the attribute selector, that css rule will not work whatever code is inside.
编辑:输入的Css规则[type =button]和输入[type =submit] DO工作,但对于输入[type =text]不工作。
Css rules for input[type="button"] and input[type="submit"] DO work, but for input[type="text"] DO NOT work. I'm really confused right now.
推荐答案
只有当指定了!DOCTYPE时,IE7和IE8才支持属性选择器。 IE6和更低版本不支持属性选择。
IE7 and IE8 support attribute selectors only if a !DOCTYPE is specified. Attribute selection is NOT supported in IE6 and lower.
这篇关于Css属性选择器输入在IE8不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!