输入类型的Css属性选择器=“按钮”不工作在IE7 [英] Css attribute selector for input type="button" not working on IE7
问题描述
我正在一个大的形式,它包含了很多的按钮,所有的形式,因此,我试图获得工作输入[type =按钮]在我的主css文件,所以它会捕获所有的按钮与out因为某些原因,这不是在IE7上工作,在检查网络后,它说,IE7应该支持这个。
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 catch all buttons with out having to add a class to every single one, for some reason this is not working on IE7, after checking on the web it says that IE7 should be supporting this.
它必须是type =button而不是type =submit,因为并非所有按钮都会提交表单。
Also it has to be type="button" and not type="submit" as not all buttons will submit the form.
任何人都可以提示我做错了什么?
Could anybody give a hint what am I doing wrong?
input[type="button"] {
text-align:center;
}
我也试过了 input [type = button] c> c> $
推荐答案
code>选择器在IE7或IE8工作。原因是HTML页面缺少一个!DOCTYPE声明。一旦我添加
I was struggling getting input[type=button]
selectors working in IE7 or IE8. The problem turned out to be that the HTML Pages were missing a "!DOCTYPE" declaration. Once I added
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
然后一切正常。你很明显可以使用不同的!DOCTYPE声明来满足你的要求。
Then everything worked fine. You can obviously use a different "!DOCTYPE" declaration to suit your requirements.
这篇关于输入类型的Css属性选择器=“按钮”不工作在IE7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!