如何在Internet Explorer的XSL文档中包含CSS样式表?

时间:2011-10-20 12:28:16

标签: html css xslt

我们如何将CSS样式表(style.css)添加到XSL文件中,以便它可以在Internet Explorer中运行?

<head>
    <title><xsl:value-of select="bom/header/title"/></title>
    <link rel="stylesheet" type="text/css" href="/BOM-Download-portlet/css/styles.css" title="Style"/>
</head>

这适用于Firefox和其他现代浏览器,但不适用于IE

1 个答案:

答案 0 :(得分:1)

IE确实会导致问题,所以我在我的.html文件中添加了异常,如下所示:

<!--[if lt IE 9]>
 <script type="text/javascript" src="js/html5.js"></script>
 <style type="text/css">.bg{ behavior: url(js/PIE.htc); }</style>
<![endif]-->

<!--[if lt IE 7]>
<div style=' clear: both; text-align:center; position: relative;'>
  <a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?    ocid=ie6_countdown_bannercode">
  <img src="http://www.theie6countdown.com/images/upgrade.jpg" border="0"  alt="" />      </a>
</div>
<![endif]-->

上面的代码充当脚本,根据需要检测和更改设置,也是.html注释,因此在加载页面时不会被拾取并尝试解析。

希望这有帮助