gpt4 book ai didi

html - 如何将css添加到xsl文件中?

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

我有以下 xml 文件:

<GeneralAgenda xmlns="http://schemas.gov.sk/form/Notify.GeneralAgenda/1.1">
<subject>Lorem Ipsum is simply dum</subject>
<text>VLorem Ipsum is simply dummy text</text>
</GeneralAgenda>

由此我创建了以下 xsl 文件:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


<xsl:template match="GeneralAgenda">
<html>
<head>

</head>
<body>

<div id="main" class="layoutMain">
<div class="layoutRow ui-tabs ui-widget-content">
<div class="caption ui-widget-header">
<div class="headercorrection">Lorem Lorem</div>
</div>

<div><label class="labelVis">Bla bla: </label>

<span class="contentVis wordwrap">

<xsl:value-of select="subject"/>

</span>

</div>

<div class="clear"> </div>
<div><label class="labelVis">Text: </label>
<span class="contentVis wordwrap">

<xsl:value-of select="text"/>

</span>
</div>
<div class="clear"> </div>
</div>
</div>

</body>

</html>
</xsl:template>

</xsl:stylesheet>

我从 xml 生成 html 文件,这工作正常,但我不知道如何将 css 样式包含到创建的 xsl 文件中。我需要添加这个 css:

body { 
font-family: 'Open Sans', 'Segoe UI', 'Trebuchet MS', 'Geneva CE', lucida, sans-serif;
background : #ffffff !important ;
}
.ui-tabs {
padding: .2em;
position: relative;
zoom: 1;
}
.clear { clear: both; height: 0;}
.layoutMain {
margin: 0px auto;
padding: 5px 5px 5px 5px;
}
.layoutRow { margin-bottom: 5px; }
.caption { /*width: 100%; border-bottom: solid 1px black;*/ }
.nocaption > .caption { border: 0px !important; }
.nocaption > .caption span {
background: none !important;
display: none;
}
.caption .title { padding-left: 5px; }
.headercorrection {
margin: 0px;
font-size : 1em;
font-weight: bold;
}
.labelVis {
float: left;
font-weight: bold;
font-family: 'Open Sans', 'Segoe UI', 'Trebuchet MS', 'Geneva CE', lucida, sans-serif;
line-height: 25px;
margin: 0px 18px 0px 0px;
padding-left: 3px;
width: 190px;
word-wrap: break-word;all:
font-size: 0.8em;
}
.contentVis {
float: left;
line-height: 25px;
margin: 0px;
padding: 0px;
vertical-align: top;
font-size: 0.75em;
}
.wordwrap {
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
.ui-widget-content {
background : 50% 50% repeat-x #ffffff;
border : #d4d4d4 solid 2px;
color : #4f4e4e;
border-radius : 3px;
}
.ui-widget-header {
cursor : pointer;
font-size : 0.8em;
color : #494949;
padding-left : 2px;
border : #eae9e8 solid 1px;
background-color : #eae9e8;
margin-bottom: 3px;
border-radius : 3px;
}

我尝试将其置于 head 标签样式中,但没有任何反应,生成的输出没有样式,我也尝试了 link 标签,但结果相同。

对此可能的解决方案是什么?

最佳答案

过程 1:将您的 css 放在 head 元素之间

<head>
<style type="text/css">
....
</style>
</head>

过程2:将css文件保存到本地,并在head元素之间调用

<head>
<link href="{CSSName}.css" rel="stylesheet" type="text/css">
</head>

关于html - 如何将css添加到xsl文件中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49317633/

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