当前位置:网站首页>How to use Alibaba Vector Icon
How to use Alibaba Vector Icon
2022-06-30 14:32:00 【Domineering ape General Manager】
1. Open the official website of Alibaba vector icon library (https://www.iconfont.cn/), You can log in directly if you have an account , If you don't have an account, you need to register one .
2. Find the icon you want .
Easy to use
If you just need oneortwo icons : For example, you want to reverse the triangle , Search directly “ Inverted triangle ”, The corresponding icon appears , Click on the desired icon ” download “ Button 
Then a pop-up box will appear , Here you can choose the color you want 
You can select the corresponding download format :
(1) If choose PNG Format , Download the picture directly html Insert .( Image file URL Depending on the location of your picture . Here are html The same directory as the picture file )
<img src="/1.png" alt="">
(2) If you click “ Copy SVG Code ” Button , Put the copied code directly in html Paste in .( For a long , I don't recommend )
<svg t="1630999448373" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3389" data-spm-anchor-id="a313x.7781069.0.i1" width="200" height="200"><path d="M1024 255.996 511.971 767.909 0 255.996 1024 255.996z" p-id="3390"></path></svg>
Mass use
If you need Alibaba vector icon library in large quantities , Icons can be added to the project :
Then enter “ My project ”,
(1) Local use
Click on “ Download to local ” Button 
After the downloaded file is unzipped , It looks like this inside :
Let me use the simplest example to show three ways to use vector icons :
In the element through link The element is imported into the file just downloaded and unzipped iconfont.css file
<link href="font/iconfont.css" rel="stylesheet" type="text/css" />
<1> Mode one Unicode
Copy the desired icon Unicode( As shown in the figure above ), then
<i class="iconfont"></i>
Immediate effect :
<2> Mode two Font class
Copy the class name of the required icon ( As shown in the figure above ), then
<i class="iconfont icon-daosanjiao"></i>
( Be careful : Element can't just add the class name of the icon you want to display , Remember to add the class name iconfont.)
Immediately show the same results 
<3> Mode three Symbol
Introduce... At the bottom of the label js file
<script src="font/iconfont.js"></script>
html
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-daosanjiao"></use>
</svg>
css
.icon{
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
(2) Online links use


Copy the code shown in the above two figures , On the basis of local use , Will introduce js and css Replace with the following :

( The benefits of online links are , You don't have to download the icon every time you add an icon to the icon library as you would for local use )
边栏推荐
- Thoughts on the security of a PHP file name regular verification
- Mutex lock, read / write lock, spin lock, pessimistic lock, and optimistic lock
- LeetCode_ Stack_ Medium_ 227. basic calculator II (without brackets)
- QQ was stolen? The reason is
- Optimization of unit test efficiency: why test programs? What are the benefits of testing?
- Notes on reverse learning in the first week of winter vacation
- Tencent two sides: @bean and @component are used on the same class. What happens?
- 数据恢复软件EasyRecovery15下载
- @component使用案例
- Je suis à Foshan, où puis - je ouvrir un compte? L'ouverture d'un compte par téléphone mobile est - elle sécurisée?
猜你喜欢

Learn about data kinship JSON format design from sqlflow JSON format

Error on datetime when importing SQL file from MySQL

编程实战赛来啦!B站周边、高级会员等好礼送你啦!

Google Earth engine (GEE) -- converts string to number and applies it to time search (ee.date.fromymd)

Google Earth engine (GEE) - ghsl: global human settlements layer, built grid 1975-1990-2000-2015 (p2016) data set

XSS challenge (6-10) more detailed answers

Realize a simple LAN communication (similar to feiqiu)

I love network security for new recruitment assessment

Thinkphp5 log file contains trick

Using docker to manage MySQL services under Windows
随机推荐
ctfshow nodejs
Lfi-rce without controllable documents
Logiciel de récupération de données easyrecovery15 téléchargement
Detailed explanation of the first three passes of upload Labs
Google Earth engine (GEE) - ghsl: global human settlements layer, built grid 1975-1990-2000-2015 (p2016) data set
"As a service", the inevitable choice of enterprise digital transformation
Wechat applet realizes map navigation + door-to-door recycling
KnightCTF WEB
LeetCode_ Stack_ Medium_ 227. basic calculator II (without brackets)
The programming competition is coming! B station surrounding, senior members and other good gifts to you!
“即服务”,企业数字化转型的必然选择
Summary of use of laravel DCAT admin
Introduction to reverse commissioning - VA and RVA conversion in PE 04/07
Ctfshow getting started with the web (ThinkPHP topic)
Small exercise of process and signal
Lifting scanning tool
XSS challenge (6-10) more detailed answers
Step by step | help you easily submit Google play data security form
More than 20 years after Hong Kong's return, Tupu digital twin Hong Kong Zhuhai Macao Bridge has shocked
Larave8 JWT API expiration custom error return