我正在尝试在 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);