当前位置:网站首页>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 )
边栏推荐
- Project management - common English vocabulary I
- Notes on reverse learning in the first week of winter vacation
- I want to ask how to open an account at China Merchants Securities? Is it safe to open a stock account through the link
- Lifting scanning tool
- Laravel upload error
- PHP generate images into Base64
- ThinkPHP show method parameter controllable command execution
- Rpm2rpm packaging steps
- [kubernetes series] k8s set mysql8 case insensitive
- Impersonate server and client using message queuing
猜你喜欢
Lifting scanning tool
Ctfshow getting started with the web (ThinkPHP topic)
Laravel upload error
go channel && select
Realize a simple LAN communication (similar to feiqiu)
Pytoch viewing model parameter quantity and calculation quantity
Crypto questions
Step by step | help you easily submit Google play data security form
After the MySQL service on the local computer is started and stopped, some services will automatically stop when they are not used by other services or programs
Shell programming overview
随机推荐
Att & CK red team evaluation field (I)
Rpm2rpm packaging steps
Problem: wechat developer tool visitor mode cannot use this function
[scientific research data processing] [practice] frequency analysis chart of category variables, distribution chart of numerical variables and normality test (including lognormal)
Realize a simple LAN communication (similar to feiqiu)
Summary of use of laravel DCAT admin
XSS challenge (1-5) more detailed answers
【Kubernetes系列】K8s设置MySQL8大小写不敏感
For loop and promise to solve the problem of concurrent callback
MySQL back to table query optimization
Problems in QT creator (additional unknown and error lines are listed in the debug output window)
Not satisfied with markdown native code block style? Try this beautify code screenshot tool~~
數據恢複軟件EasyRecovery15下載
Service online governance
Initial attack and defense world Misc
Advanced usage of go language for loop break and continue
Ctfshow getting started with the web (ThinkPHP topic)
Cost forecast of PMP (BAC, EAC, etc)
[scientific research data processing] [basic] category variable frequency analysis chart, numerical variable distribution chart and normality test (including lognormal)
Numpy creates an empty array data = np empty(shape=[1, 64,64,3])