【问题标题】:CSS Styling in XML fileXML 文件中的 CSS 样式
【发布时间】:2015-11-27 19:05:21
【问题描述】:

以下代码位于 xml 文件下,其中包含电子邮件内容。我想在#surveyName 中添加背景颜色和字体样式。帮我做

 <Body>
      &lt;html&gt;
      &lt;body&gt;
      &lt;p&gt;
      #SurveyName
      &lt;/p&gt;
      &lt;p&gt;
      We are Conducting a survey and your input would be appreciated. &lt;a href="#SurveyURL"&gt;Click Here &lt;/a&gt; to Start the survey.Thank you for your Participation.
      &lt;/p&gt;
      &lt;br&gt;
      &lt;p&gt;
     Please do not forward this email as its survey link is unique to you.
      &lt;/p&gt;
      &lt;br&gt;
      &lt;p&gt;
      Powered by Survey Management System.
      &lt;/p&gt;
      &lt;/body&gt;
      &lt;/html&gt;
    </Body>

【问题讨论】:

    标签: html css .net xml email


    【解决方案1】:

    欢迎。

    这个分析器可能对你有用,因为它在#c 中编码 htmlspecialchars https://stackoverflow.com/a/16802/1105422

    var encodedHtml = HttpContext.Current.Server.HtmlEncode("<a href=\"http://example.com\" style=\"background-color:red\">Click Here to Start the survey.</a>")
    

    【讨论】:

    • 对不起,我的第一个例子是 PHP 的。我已经编辑了我的答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-04
    • 1970-01-01
    • 1970-01-01
    • 2019-08-23
    • 1970-01-01
    • 1970-01-01
    • 2022-07-02
    相关资源
    最近更新 更多