要するに、私はこれをやりたいと思います(条件部分、私はで含める方法を知っています<h:outputStyleSheet>
):
<link rel="stylesheet" href="[path-to-dist]/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="[path-to-dist]/leaflet.ie.css" />
<![endif]-->
JSF 2 で。
ありがとう!
要するに、私はこれをやりたいと思います(条件部分、私はで含める方法を知っています<h:outputStyleSheet>
):
<link rel="stylesheet" href="[path-to-dist]/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="[path-to-dist]/leaflet.ie.css" />
<![endif]-->
JSF 2 で。
ありがとう!
使用する<h:outputText escape="false">
<h:outputText value="<!--[if lte IE 8]><link rel="stylesheet" type="text/css" href="[path-to-dist]/leaflet.ie.css"/><![endif]-->" escape="false" />
はい、それは醜い一線ですが、Facelets は本質的に XML ベースのビュー テクノロジであるため、他に方法はありません。
更新: JSF ユーティリティ ライブラリOmniFacesを使用している場合は、その<o:conditionalComment>
コンポーネントをそのまま使用できます。
<o:conditionalComment if="lte IE 8">
<link rel="stylesheet" href="[path-to-dist]/leaflet.ie.css" />
</o:conditionalComment>
<h:outputText value="#{bean.pathToDist}" />
リンクにラップできるはずだと思います。のように<link rel="stylesheet" href="<h:outputText value="#{bean.pathToDist}" />/leaflet.css" />
。
試してみてください:
<f:verbatim>
<!--[if IE]>
<link rel="stylesheet" href="path/to/file.css" />
<![endif]-->
</f:verbatim>