即使在HTML字符串中提供完全限定的URL之后,也不能应用外部CSS [英] cannot apply external CSS even after providing fully qualified URL in HTML String
问题描述
body {}
.table{
background-color:aqua
}
这是我的StyleSheet1.css保存在我本地的 C:\Users\ingyadav\Documents\Visual Studio 2015\ Projects\StyleSheet1.css
this is my StyleSheet1.css saved in my local at C:\Users\ingyadav\Documents\Visual Studio 2015\Projects\StyleSheet1.css
<html>
<head>
<link rel="stylesheet" href="file:///C:/Users/ingyadav/Documents/Visual Studio 2015/Projects/StyleSheet1.css" type="text/css" />
</head>
<body>
<table class="table" border="1" style="width:300px;height:500px">
<tr style="width:auto">
<td style="width:150px;height:500px"></td>
<td>
<table border="1" style="width:150px;height:500px">
<tr style="width:auto"><td></td></tr>
<tr style="width:auto"><td></td></tr>
<tr style="width:auto"><td></td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
这是我现在要加载到pdf的HTML字符串
And this is my HTML string to be loaded into pdf now
当我将它传递给evo html到pdf转换器时,它不会将外部css加载到pdf中。
when i pass this to the evo html to pdf converter,its not loading the external css into the pdf.
在他们提到的evopdf支持中提供完全合格的网址,但使用正确的网址也无法加载外部的CSS。
in evopdf support they mentioned to provide the fully qualified URL's but after using proper URL also its unable to load the external css.
任何人都可以帮助我。
推荐答案
不能在 href
属性中指定多个位置。根据规范,每个< link>
表示连接到您的HTML的文档。所以通过设计只会有一个文件。
No you cannot specify multiple locations in the href
attribute. Per the spec, each <link>
represents a document that is connected to your html. So by design it would be only one document.
更多示例: https://www.w3.org/TR/html401/struct/links.html#h-12.3
这篇关于即使在HTML字符串中提供完全限定的URL之后,也不能应用外部CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!