關於阿里iconfunt官網提供的矢量圖標用法介紹


  阿里iconfunt官網對於圖標的調用寫的不夠詳細,許多初用者不會用,下面具體介紹下總結的兩種方法:

一、在線調用方式

1、首先建立新浪微博賬號,用微博號登錄iconfunt官網;  

2、所需要圖標加入購物車 ;
3、存儲為項目;
4、獲取在線鏈接、生成在線鏈接;
5、選擇fontclass在線css模式;
6、把在線鏈接粘貼到link標簽;
7、用.iconfont如上,在里邊隨意修改樣式;
8、在html中需要的位置寫<i class="iconfont">此處寫圖標的編號&#...;</i>;

demo:

  

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link href="http://at.alicdn.com/t/font_1461119990_7929926.css" type="text/css" rel="stylesheet"/>
<style>


.iconfont{
font-family:"iconfont";
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
padding-left:20px 
}

</style>
</head>
<body>
<i class="iconfont">&#xe600;</i>

</body>
</html>

二、離線調用方式

  此方法需要本地下載iconfunt官網demo,然后如下,

切記要把demo里.ttf和.woff亮哥文件引入即可:

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>

@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1461117480'); /* IE9*/
src: url('iconfont.eot?t=1461117480#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff?t=1461117480') format('woff'), /* chrome, firefox */
url('iconfont.ttf?t=1461117480') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('iconfont.svg?t=1461117480#iconfont') format('svg'); /* iOS 4.1- */
}

.iconfont {
font-family:"iconfont" !important;
font-size:16px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
.icon-icon1460345725196:before { content: "\e61d"; }
</style>
</head>
<body>
<div class="box">
<i class="iconfont">&#xe600</i>
</body>
</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM