html - h :commandButton with css not the same in IE

标签 html css internet-explorer jsf-2

我有一个带有 styleClass="waiButton" 的 h:commandButton .生成的html是

<input class="waiButton" type="submit" value="Add existing" name="detailForm:j_idt184">

在 css 中我有以下内容:

a.waiButton, a.waiButton:link, a.waiButton:visited, input.waiButton[type="submit"], input.waiButton[type="button"]
{
    background: none repeat scroll 0 0 #C7E4F7;
    border-radius: 5px 5px 5px 5px;
    color: #000000;
    display: inline-block;
    font-size: 11pt;
    margin: 4px 2px;
    padding: 2px 10px;
    text-decoration: none;
}

有人能告诉我为什么在除 IE 之外的所有浏览器中我的按钮都以这种方式显示(想要的那个) enter image description here

在 IE 中是这样的 enter image description here

在带有 Firebug 的 FF 中,我可以看到按钮分配了正确的样式,而在 IE (F12) 中,样式未分配...

IE 有什么不同?任何提示将不胜感激。

编辑:

文档类型在那里:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

编辑 2:

如上所述,DOCTYPE 已设置,但我注意到一些奇怪的事情:在页面代码中看到在 FF 中单击 F12

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org TR/xhtml1/DTD/xhtml1-transitional.dtd">

在 IE 中

<!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" -->

这可以吗 <!Doctype对比<!--DOCTYPE是问题吗?

如果是,为什么 IE 将其设置为评论?在我的代码中有 <!DOCTYPE ...

最佳答案

只有 IE9+ 浏览器支持 border-radius 属性。 为了使 css 属性选择器 input.waiButton[type="submit"] 能够在 IE8 和更早的浏览器上工作,!DOCTYPE必须申报。

关于html - h :commandButton with css not the same in IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19637933/

相关文章:

javascript - 链接到 HTML 文档中的 href 时如何使用 javascript 偏移量?

javascript - 当 src 未知时隐藏图像

c# - 如何使用一些变量参数从 javascript 函数调用 asp.net C# 函数并从 C# 函数获取字符串返回?

css - Internet Explorer 中不显示表格边框

javascript - 获取执行JavaScript文件的URL(IE6-7问题moSTLy)

html - 如何自定义html表格边框?

css - css选择器中的>和空格有什么区别

html - 想要在我设置颜色的地方显示一个框,但是没有内容的跨度不会呈现?

html - 在按钮 CSS 上居中文本

javascript - doPostback 在 IE 11+ Windows 8.1 中失败