gpt4 book ai didi

c# - HandlebarsJs.Net 链接样式表/CSS

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

我正尝试在 C#.net 类文件中呈现 CSS 和我的 HTML,如下所示,但样式未呈现。其他一切工作正常。我该如何链接样式表?

string source =
@"<html>
<head>
<style type=""text/css"" href="styles.css">
</head>
<body>
<div>
<h1>{{title}}</h1>
<div class="myclass">
{{body}}
</div>
</div>
</body>
</html>";

var template = Handlebars.Compile(source);

var data = new {
title = "My new post",
body = "This is my first post!"
};

var result = template(data);

最佳答案

此问题与 Handlebars.Net 无关,而是 improper usage of Itextsharp :

the problem is with the Itextsharp.dll we are using to render the css to the pdf file.

关于c# - HandlebarsJs.Net 链接样式表/CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38596705/

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