gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 16:14:11 25 4
gpt4 key购买 nike

我们如何将 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 中无效

最佳答案

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

<!--[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 注释中,因此不会在加载页面时被提取和尝试解析。

希望对你有帮助

关于html - 如何在 Internet Explorer 的 XSL 文档中包含 CSS 样式表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7835909/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com