css - 使用@import 时的子资源完整性

标签 css

使用@import 时包含子资源完整性的语法是什么?

@import url(//use.fontawesome.com/releases/v5.3.1/css/all.css);

基本上,当像上面那样使用 @import 时,我该如何包含子资源完整性和跨域参数?

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">

最佳答案

TL;DR:SRI 是浏览器的东西,CSS at 规则(如@import)是 css 的东西。

What is the syntax to include subresource integrity when using @import?

据我所知,当前的 CSS 规范(撰写本文时起草的 CSS3)中没有任何内容 - 定义了 @import 的用法 - 详细说明了 SRI 在 css 中的用法。

Besically how do I include the subresource integrity and crossorigin parameters when using @import like above?

这些参数定义了浏览器如何获取资源并解释其合法性。这发生在资源实现(js、css 等)之前。


外部资源:

关于css - 使用@import 时的子资源完整性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52300118/

相关文章:

html - 等宽列可能与 flexbox

html - 尝试使用移动优先方法应用粘性页脚

css - 自定义 jquerymobile 按钮

html - 表头重复打印时下标或上标标签内容丢失

html - 在 chrome 中单击时显示输入类型文本边框

html - 如何使用 bootstrap 和 css 使元素响应?

jquery - 如何覆盖位于多个 css id 和类中的内联 !important

javascript - 使用 jquery 删除 html 中的样式标签

html - 如何检测 CSS 中的空格并删除分隔符

html - 两个 'boxes' 一个在下面,另一个在右边