从npm加载css文件与从cdn加载css文件时出现问题。
使用下面的CDN,我可以毫无问题地呈现表单。
<link rel='stylesheet' href='https://unpkg.com/formiojs@latest/dist/formio.full.min.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/formiojs@3.9.3/dist/formio.full.min.css' />
但是,当我从本地CSS文件呈现表单时,表单呈现不正确
<link rel='stylesheet' src="/lib/formiojs/dist/formio.full.min.css" asp-append-version="true"/>
您可以看到here之间的区别
在浏览器中打开这两个文件并粘贴到diff工具中,我注意到差异似乎与位于两个位置的'×'
有关。
在文本编辑器中打开这两个文件时,它们是相同的。
在浏览器中,CDN将字符串呈现为'×'
,而npm文件将呈现为'×'
。
如何使用'×'
加载CSS文件?
我尝试向link
元素添加charset="UTF-8"
,但它仍然不能正确呈现。我认为这与编码有关。
有问题的文件可以在这里找到https://github.com/formio/formio.js/blob/master/dist/formio.full.css
发布于 2018-12-13 00:38:11
这可能是个打字错误,但你能试着替换
<link rel='stylesheet' src="/lib/formiojs/dist/formio.full.min.css" asp-append-version="true"/>
使用
<link rel='stylesheet' href="/lib/formiojs/dist/formio.full.min.css" asp-append-version="true"/>
关键的区别是使用href
而不是src
。
https://stackoverflow.com/questions/53728927
复制相似问题