我正在学习一些CSS来调整我的项目模板.我遇到了这个问题,并没有在网上找到明确的答案.在CSS中使用@import或链接有区别吗?
使用@import
<style>@import url(Path To stylesheet.css)</style>
Run Code Online (Sandbox Code Playgroud)
使用链接
<link rel="stylesheet" href="Path To stylesheet.css">
Run Code Online (Sandbox Code Playgroud)
最好的方法是什么?为什么?谢谢!
我正在使用谷歌Roboto和Roboto Sanswebfonts.阅读Google Developers Doc,有一种方法只能嵌入整个webfont的某些字母?text=customletters.
我已经生成了这两个嵌入链接:
<!-- whole roboto font -->
<link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700' rel='stylesheet' type='text/css'>
<!-- only custom letters of roboto slab using text?= -->
<link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,700?text=I%20am%20an%20example' rel='stylesheet' type='text/css'>
Run Code Online (Sandbox Code Playgroud)
1)这对我在野生动物园中不起作用.我的代码有问题吗?
2)虽然,有没有办法将这两行组合起来,以避免在每个页面加载时向另一台服务器发出两个请求?
3)最后和最不重要的是,嵌入@import和link href嵌入方式是否会对性能产生任何影响?