我有一个带有 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 之外的所有浏览器中我的按钮都以这种方式显示(想要的那个)
在 IE 中是这样的
在带有 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/