直接来 self 的 CSS 文件的示例:
@import 'https://fonts.googleapis.com/css?family=Lato:700';
@import url('https://fonts.googleapis.com/css?family=Montserrat:700');
我为我的 WordPress 网站购买了一个漂亮的主题,一些 CSS 字体就是这样导入的。我将所有这些结合起来,但我不确定其中的区别。
我做了一些研究并注意到 Mozilla在他们的例子中也在两者之间切换。
最佳答案
来自W3规范:
The following lines are equivalent in meaning and illustrate both '@import' syntaxes (one with "url()" and one with a bare string):
@import "mystyle.css";
@import url("mystyle.css");
关于css - 为什么有些 css @import 命令使用 url() 而其他命令只是放置字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42879274/