gpt4 book ai didi

html - 将 CSS 与 XLST 文件分离的建议

转载 作者:太空宇宙 更新时间:2023-11-03 22:04:31 24 4
gpt4 key购买 nike

我只是想就如何改进我编写 XSLT 文件的方式寻求建议。我还想问问有没有人知道如何分离专门用于XSLT文件的CSS文件。任何建议都会对我有很大帮助 在此先感谢大家。

 <?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
<xsl:output method="html" indent="yes"/>

<xsl:template match="/">
<html>
<head>
<title>This is my tes application</title>
<style type="text/css">
body
{
/*Background Properties*/
background-color:#b0c4de;

/*Font Properties*/
font-family:Arial;
font-size:14px;
}

.TitleStyle
{
/*Text Properties*/
text-align:left;

/*Font Properties*/
font-size:24;

/*Layout Properties*/
margin-bottom: 5px;
}

.Wrapper
{
padding: 5px;
border-width:2px;
border-style:solid;
}

.WhiteHeader
{
color:white;
}

.ProviderStyle
{
font-size:18px;
}

</style>
</head>
<body>
<xsl:for-each select="JobRequistions/JobRequisition">
<hr />
<div class="Wrapper">
<div class="TitleStyle">
<font class="WhiteHeader">
<xsl:value-of disable-output-escaping="yes" select="title" />
</font>
<font class="ProviderStyle">
@ <xsl:value-of disable-output-escaping="yes" select="job_board_provider"/>
</font>
</div>
Number of openings: <xsl:value-of disable-output-escaping="yes" select="number_of_openings"/>
<hr />
</div>
<hr />
</xsl:for-each >
</body>
</html>
</xsl:template>
</xsl:stylesheet>

最佳答案

您可以像在 html 中一样使用外部样式表,只需在头部添加一个链接即可。

关于html - 将 CSS 与 XLST 文件分离的建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7756594/

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