Css attribute selector for input type=“button” not working on IE7

前端 未结 8 1290
执笔经年
执笔经年 2020-12-05 20:38

I am working on a big form and it contains a lot of buttons all over the form, therefore I am trying to get working input[type=\"button\"] in my main css file so it would ca

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-05 21:06

    Attribute selectors are, unfortunately, not yet well implemented in all major browsers, because it is CSS3 and not 2.1, the current standard. Because the guys over at W3C are not that quick in making decisions, you better not set your hopes too high, because we won't be able to use css3 any time soon. Some aspects of it are already implemented, but this one isn't (surely not in IE6).

    So, as you already said yourself, it would be much better to provide all of your inputs with a class, and make it a habit to do so every time you create a form. It's always handy and not a lot of work when you are already programming the form.

    When I create a form, I always add the type of an input as a class, e.g.:

    Especially the last two will come in handy in a lot of cases, because you don't háve to style the .button and .submit separately, but you cóuld if you would like to do so.

提交回复
热议问题