如果这是一个非常简单的问题我很抱歉,但是你如何使用没有的谷歌材料图标
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
Run Code Online (Sandbox Code Playgroud)
?
我希望我的应用程序能够显示图标,即使用户没有互联网连接
我是webpack 2.2的新手; 我想知道在我的项目中集成Google字体的最佳方法.
我正在使用Webpack HTML插件index.html
从模板生成一个.所以目前我直接在<script>
标签中对Google字体CSS进行了硬编码,但我并不喜欢这种"解决方案",因为它根本不使用webpack:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<link href="https://fonts.googleapis.com/css?family=Love+Ya+Like+A+Sister" rel="stylesheet">
<body>
<div id='app'/>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我在使用Google网络字体时遇到了一些奇怪的行为.现在我正在使用它就像嵌入样式表一样,它运行正常.
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:300|Orienta' rel='stylesheet' type='text/css'>
Run Code Online (Sandbox Code Playgroud)
但是当我将这个@ font-face值用于我的css文件时,它无法正常工作.
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 300;
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url(http://themes.googleusercontent.com/static/fonts/sourcesanspro/v4/toadOcfmlt9b38dHJxOBGNbE_oMaV8t2eFeISPpzbdE.woff) format('woff');
}
@font-face {
font-family: 'Orienta';
font-style: normal;
font-weight: 400;
src: local('Orienta'), local('Orienta-Regular'), url(http://themes.googleusercontent.com/static/fonts/orienta/v1/nPJ0J30J_zQZtBhztPPbaA.woff) format('woff');
}
Run Code Online (Sandbox Code Playgroud)
这些代码发生了什么,我认为它们在上面都有相同的作用.伙计们好吗?
注意.另外我打算将这些字体下载到我的系统并从服务器加载它.提前致谢.
cordova ×1
css ×1
fonts ×1
html5 ×1
javascript ×1
materialize ×1
npm ×1
webfonts ×1
webpack-2 ×1