Last active
August 31, 2018 10:26
-
-
Save JingwenTian/854c09bf9f93d97acfbb575ca79b3226 to your computer and use it in GitHub Desktop.
Icon Font Demo (source https://jsbin.com/mokace)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
/*引入 font icon*/ | |
/*@font-face 具体的用法可以查一下, 用于引入外部字体*/ | |
@font-face { | |
font-family: global-iconfont; | |
src: url(http://at.alicdn.com/t/font_1404888168_2057645.eot); | |
src: url(http://at.alicdn.com/t/font_1404888168_2057645.eot?#iefix) format("embedded-opentype"),url(//at.alicdn.com/t/font_1404888168_2057645.woff) format("woff"),url(//at.alicdn.com/t/font_1404888168_2057645.ttf) format("truetype"),url(//at.alicdn.com/t/font_1404888168_2057645.svg#uxiconfont) format("svg") | |
} | |
/*指定应用图标的class,应用引入的global-iconfont字体*/ | |
.site-nav .site-nav-icon { | |
font-family: global-iconfont; | |
font-size: 12px; | |
font-style: normal; | |
margin-top: -3px\9; | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscaleFont type; | |
margin-right: 5px; | |
_line-height: 33px; | |
color: #9c9c9c | |
} | |
/*选中的效果, 指定一个颜色*/ | |
.site-nav .site-nav-icon-highlight { | |
color: #f40; | |
} | |
</style> | |
</head> | |
<body> | |
<ul class="site-nav"> | |
<li>购物车 <span class="site-nav-icon site-nav-icon-highlight"></span></li> | |
<li>收藏夹 <span class="site-nav-icon"></span></li> | |
</ul> | |
<script id="jsbin-source-css" type="text/css">/*引入 font icon*/ | |
/*@font-face 具体的用法可以查一下, 用于引入外部字体*/ | |
@font-face { | |
font-family: global-iconfont; | |
src: url(http://at.alicdn.com/t/font_1404888168_2057645.eot); | |
src: url(http://at.alicdn.com/t/font_1404888168_2057645.eot?#iefix) format("embedded-opentype"),url(//at.alicdn.com/t/font_1404888168_2057645.woff) format("woff"),url(//at.alicdn.com/t/font_1404888168_2057645.ttf) format("truetype"),url(//at.alicdn.com/t/font_1404888168_2057645.svg#uxiconfont) format("svg") | |
} | |
/*指定应用图标的class,应用引入的global-iconfont字体*/ | |
.site-nav .site-nav-icon { | |
font-family: global-iconfont; | |
font-size: 12px; | |
font-style: normal; | |
margin-top: -3px\9; | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscaleFont type; | |
margin-right: 5px; | |
_line-height: 33px; | |
color: #9c9c9c | |
} | |
/*选中的效果, 指定一个颜色*/ | |
.site-nav .site-nav-icon-highlight { | |
color: #f40; | |
}</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*引入 font icon*/ | |
/*@font-face 具体的用法可以查一下, 用于引入外部字体*/ | |
@font-face { | |
font-family: global-iconfont; | |
src: url(http://at.alicdn.com/t/font_1404888168_2057645.eot); | |
src: url(http://at.alicdn.com/t/font_1404888168_2057645.eot?#iefix) format("embedded-opentype"),url(//at.alicdn.com/t/font_1404888168_2057645.woff) format("woff"),url(//at.alicdn.com/t/font_1404888168_2057645.ttf) format("truetype"),url(//at.alicdn.com/t/font_1404888168_2057645.svg#uxiconfont) format("svg") | |
} | |
/*指定应用图标的class,应用引入的global-iconfont字体*/ | |
.site-nav .site-nav-icon { | |
font-family: global-iconfont; | |
font-size: 12px; | |
font-style: normal; | |
margin-top: -3px\9; | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscaleFont type; | |
margin-right: 5px; | |
_line-height: 33px; | |
color: #9c9c9c | |
} | |
/*选中的效果, 指定一个颜色*/ | |
.site-nav .site-nav-icon-highlight { | |
color: #f40; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment