cannot apply external CSS even after providing fully qualified URL in HTML String

試著忘記壹切 提交于 2019-12-12 03:29:46

问题


body {}
.table{
    background-color:aqua
}

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>

And this is my HTML string to be loaded into pdf now

when i pass this to the evo html to pdf converter,its not loading the external css into the pdf.

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.

can anyone help me on this please.


回答1:


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.

More Example: https://www.w3.org/TR/html401/struct/links.html#h-12.3



来源:https://stackoverflow.com/questions/37392418/cannot-apply-external-css-even-after-providing-fully-qualified-url-in-html-strin

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!