在我的css中添加文本,并将其显示在html电子邮件页面中
我想知道是否有一种方法可以在css中添加“文本”,这样html页面就可以把它写出来。 这是因为html页面无法处理我的inparameters(${var})。 我正在使用jenkins可编辑电子邮件插件 所以我有我的css:在我的css中添加文本,并将其显示在html电子邮件页面中,css,jenkins,jenkins-plugins,Css,Jenkins,Jenkins Plugins,我想知道是否有一种方法可以在css中添加“文本”,这样html页面就可以把它写出来。 这是因为html页面无法处理我的inparameters(${var})。 我正在使用jenkins可编辑电子邮件插件 所以我有我的css: <style type="text/css"> a{color:#4a72af} body{background-color:#e4e4e4} body,p{margin:0;padding:0} img{display:block} h1,h2,h3,h4,
<style type="text/css">
a{color:#4a72af}
body{background-color:#e4e4e4}
body,p{margin:0;padding:0}
img{display:block}
h1,h2,h3,h4,h5,h6{margin:0 0 .8em 0}
h3{font-size:28px;color:#444!important;font-family:Arial,Helvetica,sans-serif}
h4{font-size:22px;color:#4a72af!important;font-family:Arial,Helvetica,sans-serif}
h5{font-size:18px;color:#444!important;font-family:Arial,Helvetica,sans-serif}
p{font-size:12px;color:#444!important;font-family:"Lucida Grande","Lucida Sans","Lucida Sans Unicode",sans-serif;line-height:1.5}
ol li img{display:inline;height:20px}
/*div styles*/
.news{text-align:center;padding-top:15px;}
.content{width:720px;margin:0 auto;background-color:white}
.round_border{margin-bottom:5px;-webkit-border-radius:6px;-moz-border-radius:6px;border- radius:6px;margin-top:0;font-size:14px;padding:6px;border:1px solid #ccc}
.status{background-color:<%=
${MyVar} == "Open" ? 'green' : 'red' %>;font-size:28px;font-weight:bold;color:white;width:720px;height:52px;margin-bottom:18px;text-align:center;vertical-align:middle;border-collapse:collapse;background-repeat:no-repeat}
.status .info{color:white!important;text-shadow:0 -1px 0 rgba(0,0,0,0.3);font-size:32px;line-height:36px;padding:8px 0}
.main img{width:38px;margin-right:16px;height:38px}
.main table{font-size:14px;}
.main table th{text-align:right;}
.bottom-message{width:720px;cellpadding:5px;cellspacing:0px}
.bottom-message .message{font-size:13px;color:#aaa;line-height:18px;text-align:center}
.bottom-message .designed{font-size:13px;color:#aaa;line-height:18px;font-style: italic;text-align:right}
</style>
<body>
<div class="content round_border">
<div class="status">
<p class="info">TEST</p>
</div>
<!-- status -->
<div class="main round_border">
<table>
<tbody>
<tr>
<th>Name:</th>
<td>HERE IS WHERE THE TEXT SHOULD BE</td>
</tr>
....
然后将此添加到
<td class="test"></td>
有没有办法做到这一点?那么,您可以使用::before或::after伪元素并设置它们的内容:
div::after
{
content: 'Hello!';
}
听起来你是在试图修补某些东西,而不是找出实际错误的来源。。我会读代码吗??嗯,不!我知道问题所在。我需要写一个插件来解决这个问题,因为这是一个包装代码。这就是为什么如果可能的话,我想用这个快速解决方案来解决这个问题-(可能必须这样做,这是在电子邮件中发送的,不会显示在浏览器中。在我尝试之后,请尝试仅使用一个冒号:div:。它在电子邮件中工作正常,但在与邮件一起运行时则不起作用。
.test ${MyVar2}
<td class="test"></td>
div::after
{
content: 'Hello!';
}