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

前端 未结 8 1254
执笔经年
执笔经年 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:21

    I've had no problems getting css statements like that working in IE7; IE6 is always the problem but I believe this CSS would work in there as well. So I don't think IE7 is the problem.

    The first thing is that your CSS sample will only affect buttons, it will not affect submit buttons. But that's an easy fix; change your css to:

    input[type="submit"], input[Type="button"]
    { text-align: center; }
    

    Second, as Manolo Santos said, could you have another CSS statement that is overriding the text-align setting? A setting on just input elements? It's probably worth using a developer tool like Firebug or the developer components built into Chrome or IE8 to help find the CSS problem.

    0 讨论(0)
  • 2020-12-05 21:22

    I am pretty sure everybody is aware of the fact that the solution of adding a !DockType to the header isn't a possibility all the time.

    For instance, I develop in DotNetNuke (DNN) environment which the developer doesn't have an access to the header. Then it makes it almost impossible to add !DocType.

    In this case you don’t have too much of an option except relating a CssClass to the button and referring to it, explicitly, in the CSS module.

    0 讨论(0)
提交回复
热议问题