【发布时间】:2014-08-14 19:18:10
【问题描述】:
我正在根据条件 cmets 设置图像宽度,如下所示。
<o:conditionalComment if="lte IE 9">
<style>
.image-width {
width: 210px;
}
</style>
</o:conditionalComment>
<o:conditionalComment if="!IE">
<style>
.image-width {
width: 216px;
}
</style>
</o:conditionalComment>
它适用于 Internet Explorer (8)。 IE 8 将图像宽度设置为210px。但是,其他浏览器上的图像宽度应设置为216px。最后一个条件注释,即 !IE 在其他浏览器(Chrome 和 FF)上不起作用。
如何在IE以外的浏览器上应用width: 216px;样式?
生成的 HTML 代码看起来是正确的,如下所示。
<!--[if lte IE 9]>
<style>
.image-width {
width: 210px;
}
</style><![endif]-->
<!--[if !IE]>
<style>
.image-width {
width: 216px;
}
</style><![endif]-->
【问题讨论】:
标签: css jsf jsf-2.2 omnifaces conditional-comments