简体   繁体   中英

How can I include a CSS stylesheet in an XSL document for Internet Explorer?

How we can add a CSS stylesheet (style.css) to an XSL file so that it works in 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>

This is working in Firefox and other modern browsers, but not in IE

IE does tend to cause a problem, so I've added exceptions in my .html files like so:

<!--[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]-->

The code as above acts as a script, detecting and changing the settings as required, also, it is in .html comments, so not picked up and attempted to be parsed while loading the page.

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM