输入类型=“按钮"的CSS属性选择器无法在 IE7 上运行

Css attribute selector for input type=quot;buttonquot; not working on IE7(输入类型=“按钮的CSS属性选择器无法在 IE7 上运行)
本文介绍了输入类型=“按钮"的CSS属性选择器无法在 IE7 上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在处理一个大表单,它在整个表单中包含很多按钮,因此我试图在我的主 css 文件中获取有效的 input[type="button"] 以便它可以捕获所有按钮必须为每个单独的类添加一个类,由于某种原因,这在 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]

推荐答案

我很难让 input[type=button] 选择器在 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 上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
How do I make a TextGeometry multiline? How do I put it inside a square so it wraps like html text does inside a div?(如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?) - IT屋-程序员软件开发技术分享社
Scale background image to fit ie8 window(缩放背景图像以适合 ie8 窗口)
@fontface in IE7 (IETEster) not working properly(IE7 (IETEster) 中的@fontface 无法正常工作)
Safari 5.1 breaks CSS table cell spacing(Safari 5.1 打破 CSS 表格单元格间距)
Put in bold part of description in metatag Drupal module(将描述的粗体部分放在元标记 Drupal 模块中)