Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Css attribute selector for inputs not working in IE8

Tags:

html

css

input

I have the following css code working in Firefox/Chrome but not in IE8

input[type='text']
{
    float: right;
    width: 170px;
}

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;
}

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.

EDIT: 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.

like image 499
Lola Avatar asked Mar 24 '26 08:03

Lola


1 Answers

IE7 and IE8 support attribute selectors only if a !DOCTYPE is specified. Attribute selection is NOT supported in IE6 and lower.

like image 189
Ketan Modi Avatar answered Mar 25 '26 20:03

Ketan Modi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!