Google Material Design的图标字体使用教程

简介: 使用教程 1. 打开Material icons下载页 2. 选择要下载的图标 (目前不能多选>_

使用教程

1. 打开Material icons下载页

2. 选择要下载的图标 (目前不能多选>_<)

3.选择要下载的格式即可

图标字体使用教程

【方法一】

STEP 1: 引入字体文件和样式文件,下面这个是直接引用google的字体托管文件,如果国内使用建议不要用托管的,会访问慢,把字体下载到自己的服务器上,详细看【方法二】

<link href=”https://fonts.googleapis.com/icon?family=Material+Icons” rel=”stylesheet”>

STEP 2: HTML代码,在HTML标签上加入class=”material-icons”以及写上图标名称即可,如下:

<i class=”material-icons”>face</i>

【方法二】

如果你不想使用Google托管的CSS文件和图标字体,可以下载到本地。

STEP 1: 下载字体文件到本地

下载地址:https://github.com/google/material-design-icons/tree/master/iconfont

STEP 2 : 为你的CSS引入字体

@font-face {

font-family: 'Material Icons';

font-style: normal;

font-weight: 400;

src: url(https://example.com/MaterialIcons-Regular.eot); /* For IE6-8 */

src: local('Material Icons'),

local('MaterialIcons-Regular'),

url(https://example.com/MaterialIcons-Regular.woff2) format('woff2'),

url(https://example.com/MaterialIcons-Regular.woff) format('woff'),

url(https://example.com/MaterialIcons-Regular.ttf) format('truetype');

}

 

.material-icons {

font-family: 'Material Icons';

font-weight: normal;

font-style: normal;

font-size: 24px; /* Preferred icon size */

display: inline-block;

width: 1em;

height: 1em;

line-height: 1;

text-transform: none;

 

/* Support for all WebKit browsers. */

-webkit-font-smoothing: antialiased;

/* Support for Safari and Chrome. */

text-rendering: optimizeLegibility;

 

/* Support for Firefox. */

-moz-osx-font-smoothing: grayscale;

 

/* Support for IE. */

font-feature-settings: 'liga';

}

STEP 3: HTML代码

<i class="material-icons">face</i>

更新详细的使用教程:http://google.github.io/material-design-icons/

网站名称:Material icons

网站地址:https://www.google.com/design/icons/

 

相关文章
|
5天前
|
自然语言处理 搜索推荐 SEO
如何使用 Google 搜索引擎保姆级教程(附链接)
如何使用 Google 搜索引擎保姆级教程(附链接)
|
Linux 网络安全 数据安全/隐私保护
linux 本地终端 SSH 连接 gcp (Google Cloud Platform ) 配置教程
linux 本地终端 SSH 连接 gcp (Google Cloud Platform ) 配置教程
7675 0
|
5天前
|
Java 数据安全/隐私保护
SpringBoot【集成Thumbnailator】Google开源图片工具缩放+区域裁剪+水印+旋转+保持比例等(保姆级教程含源代码)
SpringBoot【集成Thumbnailator】Google开源图片工具缩放+区域裁剪+水印+旋转+保持比例等(保姆级教程含源代码)
89 0
|
7月前
|
数据处理 开发者 Python
Google Earth Engine Map教程书中英双语
Google Earth Engine Map教程书中英双语
147 0
|
算法 双11 Python
6.18专属特惠活动:Google Earth Engine专栏、GEE教程训练专栏、GEE-python专栏和GEE案例分析专栏等限时特价
6.18专属特惠活动:Google Earth Engine专栏、GEE教程训练专栏、GEE-python专栏和GEE案例分析专栏等限时特价
96 0
6.18专属特惠活动:Google Earth Engine专栏、GEE教程训练专栏、GEE-python专栏和GEE案例分析专栏等限时特价
利用GEE(Google Earth Engine)在线处理NDVI、EVI、SAVI、NDMI等指数归一化教程!
利用GEE(Google Earth Engine)在线处理NDVI、EVI、SAVI、NDMI等指数归一化教程!
1230 0
利用GEE(Google Earth Engine)在线处理NDVI、EVI、SAVI、NDMI等指数归一化教程!
|
Web App开发 JavaScript 前端开发
Google Chrome谷歌/火狐/Safari浏览器开发者工具基本使用教程
前言        在阅读下面内容之前,那么些简单的了解浏览器开发者工具到底是什么东西,到底有什么用途。 浏览器开发者工具到底是什么?        其实简单的说,浏览器开发者工具就是给专业的web应用和网站开发人员使用的工具,当然只要你有兴趣想要了解,只要你对这个世界充满这好奇,什么东西你都可以了解。
1343 0
|
Java 测试技术 开发工具

热门文章

最新文章