123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8"/>
- <title>IconFont</title>
- <link rel="stylesheet" href="demo.css">
- <script src="iconfont.js"></script>
- <style type="text/css">
- .icon {
- /* 通过设置 font-size 来改变图标大小 */
- width: 1em; height: 1em;
- /* 图标和文字相邻时,垂直对齐 */
- vertical-align: -0.15em;
- /* 通过设置 color 来改变 SVG 的颜色/fill */
- fill: currentColor;
- /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
- normalize.css 中也包含这行 */
- overflow: hidden;
- }
- </style>
- </head>
- <body>
- <div class="main markdown">
- <h1>IconFont 图标</h1>
- <ul class="icon_lists clear">
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-tuan"></use>
- </svg>
- <div class="name">团</div>
- <div class="fontclass">#icon-tuan</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-kafei"></use>
- </svg>
- <div class="name">咖啡</div>
- <div class="fontclass">#icon-kafei</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-shequ"></use>
- </svg>
- <div class="name">社区</div>
- <div class="fontclass">#icon-shequ</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-xiazai"></use>
- </svg>
- <div class="name">下载</div>
- <div class="fontclass">#icon-xiazai</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-android"></use>
- </svg>
- <div class="name">android</div>
- <div class="fontclass">#icon-android</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-shouji"></use>
- </svg>
- <div class="name">手机</div>
- <div class="fontclass">#icon-shouji</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-dianhua"></use>
- </svg>
- <div class="name">电话</div>
- <div class="fontclass">#icon-dianhua</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-dianhua2"></use>
- </svg>
- <div class="name">电话</div>
- <div class="fontclass">#icon-dianhua2</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-kefu2"></use>
- </svg>
- <div class="name">客服</div>
- <div class="fontclass">#icon-kefu2</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-xin"></use>
- </svg>
- <div class="name">心</div>
- <div class="fontclass">#icon-xin</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-yaoqing"></use>
- </svg>
- <div class="name">邀请</div>
- <div class="fontclass">#icon-yaoqing</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-goutong"></use>
- </svg>
- <div class="name">沟通</div>
- <div class="fontclass">#icon-goutong</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-shubiao"></use>
- </svg>
- <div class="name">鼠标</div>
- <div class="fontclass">#icon-shubiao</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-73316"></use>
- </svg>
- <div class="name">医疗</div>
- <div class="fontclass">#icon-73316</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-yumingjiexi"></use>
- </svg>
- <div class="name">域名解析</div>
- <div class="fontclass">#icon-yumingjiexi</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-xuchaobiaoqian"></use>
- </svg>
- <div class="name">别针</div>
- <div class="fontclass">#icon-xuchaobiaoqian</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-mjiantou"></use>
- </svg>
- <div class="name">右箭头</div>
- <div class="fontclass">#icon-mjiantou</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-app"></use>
- </svg>
- <div class="name">app</div>
- <div class="fontclass">#icon-app</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-canyin"></use>
- </svg>
- <div class="name">餐饮</div>
- <div class="fontclass">#icon-canyin</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-svgiconyouxi"></use>
- </svg>
- <div class="name">眼睛</div>
- <div class="fontclass">#icon-svgiconyouxi</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-ios"></use>
- </svg>
- <div class="name">ios</div>
- <div class="fontclass">#icon-ios</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-kaifa"></use>
- </svg>
- <div class="name">开发</div>
- <div class="fontclass">#icon-kaifa</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-weixin"></use>
- </svg>
- <div class="name">微信</div>
- <div class="fontclass">#icon-weixin</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-huojian"></use>
- </svg>
- <div class="name">1火箭</div>
- <div class="fontclass">#icon-huojian</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-service"></use>
- </svg>
- <div class="name">服务</div>
- <div class="fontclass">#icon-service</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-kaiqihuodong"></use>
- </svg>
- <div class="name">开启活动</div>
- <div class="fontclass">#icon-kaiqihuodong</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-diannao1"></use>
- </svg>
- <div class="name">电脑</div>
- <div class="fontclass">#icon-diannao1</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-o2o"></use>
- </svg>
- <div class="name">O2O</div>
- <div class="fontclass">#icon-o2o</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-kaxinxi"></use>
- </svg>
- <div class="name">会员卡</div>
- <div class="fontclass">#icon-kaxinxi</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-qiuhuixuanzhong"></use>
- </svg>
- <div class="name">球会选中</div>
- <div class="fontclass">#icon-qiuhuixuanzhong</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-xianshang"></use>
- </svg>
- <div class="name">线上</div>
- <div class="fontclass">#icon-xianshang</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-wifi"></use>
- </svg>
- <div class="name">wifi</div>
- <div class="fontclass">#icon-wifi</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-lvyou"></use>
- </svg>
- <div class="name">旅游</div>
- <div class="fontclass">#icon-lvyou</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-qq"></use>
- </svg>
- <div class="name">qq</div>
- <div class="fontclass">#icon-qq</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-kefu1"></use>
- </svg>
- <div class="name">客服</div>
- <div class="fontclass">#icon-kefu1</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-weihu"></use>
- </svg>
- <div class="name">维护</div>
- <div class="fontclass">#icon-weihu</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-fene"></use>
- </svg>
- <div class="name">买入份额</div>
- <div class="fontclass">#icon-fene</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-top"></use>
- </svg>
- <div class="name">返回顶部</div>
- <div class="fontclass">#icon-top</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-xitong"></use>
- </svg>
- <div class="name">系统</div>
- <div class="fontclass">#icon-xitong</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-menu"></use>
- </svg>
- <div class="name">菜单</div>
- <div class="fontclass">#icon-menu</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-jianrongxing"></use>
- </svg>
- <div class="name">兼容性</div>
- <div class="fontclass">#icon-jianrongxing</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-gengduo"></use>
- </svg>
- <div class="name">更多</div>
- <div class="fontclass">#icon-gengduo</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-ui"></use>
- </svg>
- <div class="name">UI</div>
- <div class="fontclass">#icon-ui</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-jhyxsj"></use>
- </svg>
- <div class="name">交互原型设计</div>
- <div class="fontclass">#icon-jhyxsj</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-kefu"></use>
- </svg>
- <div class="name">客服</div>
- <div class="fontclass">#icon-kefu</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-shangcheng"></use>
- </svg>
- <div class="name">商城</div>
- <div class="fontclass">#icon-shangcheng</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-cuo"></use>
- </svg>
- <div class="name">错</div>
- <div class="fontclass">#icon-cuo</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-taideng"></use>
- </svg>
- <div class="name">台灯</div>
- <div class="fontclass">#icon-taideng</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-zhenghe"></use>
- </svg>
- <div class="name">iconfont整合-29</div>
- <div class="fontclass">#icon-zhenghe</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-peixun"></use>
- </svg>
- <div class="name">培训 (1)</div>
- <div class="fontclass">#icon-peixun</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-shangchuan"></use>
- </svg>
- <div class="name">上传</div>
- <div class="fontclass">#icon-shangchuan</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-liaotian"></use>
- </svg>
- <div class="name">聊天</div>
- <div class="fontclass">#icon-liaotian</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-xiangce"></use>
- </svg>
- <div class="name">相册</div>
- <div class="fontclass">#icon-xiangce</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-xiangji"></use>
- </svg>
- <div class="name">相机</div>
- <div class="fontclass">#icon-xiangji</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-shijuesheji"></use>
- </svg>
- <div class="name">视觉设计</div>
- <div class="fontclass">#icon-shijuesheji</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-liucheng"></use>
- </svg>
- <div class="name">流程</div>
- <div class="fontclass">#icon-liucheng</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-pintu"></use>
- </svg>
- <div class="name">拼图</div>
- <div class="fontclass">#icon-pintu</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-xiazai1"></use>
- </svg>
- <div class="name">下载</div>
- <div class="fontclass">#icon-xiazai1</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-shuju"></use>
- </svg>
- <div class="name">数据</div>
- <div class="fontclass">#icon-shuju</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-sheji"></use>
- </svg>
- <div class="name">设计</div>
- <div class="fontclass">#icon-sheji</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-yingxiaoxinxi"></use>
- </svg>
- <div class="name">营销信息</div>
- <div class="fontclass">#icon-yingxiaoxinxi</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-qiche"></use>
- </svg>
- <div class="name">汽车</div>
- <div class="fontclass">#icon-qiche</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-huizhang"></use>
- </svg>
- <div class="name">徽章</div>
- <div class="fontclass">#icon-huizhang</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-huaban"></use>
- </svg>
- <div class="name">工具</div>
- <div class="fontclass">#icon-huaban</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-xiangyouyo"></use>
- </svg>
- <div class="name">向右</div>
- <div class="fontclass">#icon-xiangyouyo</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-shezhi"></use>
- </svg>
- <div class="name">设置</div>
- <div class="fontclass">#icon-shezhi</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-dianhua1"></use>
- </svg>
- <div class="name">电话</div>
- <div class="fontclass">#icon-dianhua1</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-yinhangqia"></use>
- </svg>
- <div class="name">银行卡</div>
- <div class="fontclass">#icon-yinhangqia</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-diannao"></use>
- </svg>
- <div class="name">电脑</div>
- <div class="fontclass">#icon-diannao</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-dianshang"></use>
- </svg>
- <div class="name">电商</div>
- <div class="fontclass">#icon-dianshang</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-jinrong"></use>
- </svg>
- <div class="name">金融</div>
- <div class="fontclass">#icon-jinrong</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-ziyuan"></use>
- </svg>
- <div class="name">合同</div>
- <div class="fontclass">#icon-ziyuan</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-yanshou"></use>
- </svg>
- <div class="name">6收货验收</div>
- <div class="fontclass">#icon-yanshou</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-yingyee"></use>
- </svg>
- <div class="name">累计营业额</div>
- <div class="fontclass">#icon-yingyee</div>
- </li>
-
- <li>
- <svg class="icon" aria-hidden="true">
- <use xlink:href="#icon-weixin1"></use>
- </svg>
- <div class="name">微信</div>
- <div class="fontclass">#icon-weixin1</div>
- </li>
-
- </ul>
- <h2 id="symbol-">symbol引用</h2>
- <hr>
- <p>这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
- 这种用法其实是做了一个svg的集合,与另外两种相比具有如下特点:</p>
- <ul>
- <li>支持多色图标了,不再受单色限制。</li>
- <li>通过一些技巧,支持像字体那样,通过<code>font-size</code>,<code>color</code>来调整样式。</li>
- <li>兼容性较差,支持 ie9+,及现代浏览器。</li>
- <li>浏览器渲染svg的性能一般,还不如png。</li>
- </ul>
- <p>使用步骤如下:</p>
- <h3 id="-symbol-">第一步:引入项目下面生成的symbol代码:</h3>
- <pre><code class="lang-js hljs javascript"><span class="hljs-comment"><script src="./iconfont.js"></script></span></code></pre>
- <h3 id="-css-">第二步:加入通用css代码(引入一次就行):</h3>
- <pre><code class="lang-js hljs javascript"><style type=<span class="hljs-string">"text/css"</span>>
- .icon {
- width: <span class="hljs-number">1</span>em; height: <span class="hljs-number">1</span>em;
- vertical-align: <span class="hljs-number">-0.15</span>em;
- fill: currentColor;
- overflow: hidden;
- }
- <<span class="hljs-regexp">/style></span></code></pre>
- <h3 id="-">第三步:挑选相应图标并获取类名,应用于页面:</h3>
- <pre><code class="lang-js hljs javascript"><svg <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"icon"</span> aria-hidden=<span class="hljs-string">"true"</span>><span class="xml"><span class="hljs-tag">
- <<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#icon-xxx"</span>></span><span class="hljs-tag"></<span class="hljs-name">use</span>></span>
- </span><<span class="hljs-regexp">/svg>
- </span></code></pre>
- </div>
- </body>
- </html>
|