Skip to content

Instantly share code, notes, and snippets.

@JingwenTian
Last active August 31, 2018 10:26
Show Gist options
  • Save JingwenTian/854c09bf9f93d97acfbb575ca79b3226 to your computer and use it in GitHub Desktop.
Save JingwenTian/854c09bf9f93d97acfbb575ca79b3226 to your computer and use it in GitHub Desktop.
Icon Font Demo (source https://jsbin.com/mokace)
<!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>
/*引入 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