当前位置:网站首页>Download and use of font icons
Download and use of font icons
2022-07-05 04:57:00 【qq_ forty-six million thirty-four thousand nine hundred and for】
1 Download font icon
1. Use the premise : ordinary 、 A single color picture ( It is recommended to use sprite diagram for complex or colorful )
2. The essence : It shows pictures , The essence is the font
3. advantage : Modifiable dimensions 、 size 、 Compatibility
1.1iconfont( Ali Icon Library )https://www.iconfont.cn/( Commonly used )
step : Sign in —> Icon Library —> Find Icon ( Choose different channels to find the icons you need )—> Add to cart ( Click the shopping cart on the icon )—> Click on “ The shopping cart ”—> choice “ Add to project ”( If there is no project, create a new project )—> Click on “ Download to local ”( The download is .zip, Decompression is required when using )
1.2icomoon( Extranet ) https://www.iconmoon.io/
2 Use of font icons
2.1 introduce
2.1.1 Will download .zip Extract the file , And copy the following files to fonts( Built by users ) In the folder
2.1.2 call ( adopt link call iconfont.css file , Be careful route )
<link rel="stylesheet" href="./fonts/iconfont.css"> 2.2 Use (3 Methods )
Decompressed .zip There are automatically generated “demo_index.html” file , Double-click to open , You can see the auto generated “Unicode" Character encoding and ”Font class" Class name , When use , Just use it directly .
2.2.1 Method 1 : Call... With a class name ( You must call two class names )
iconfont: Basic styles , Including the use of fonts
icon-xxx: Class name corresponding to Icon ( stay demo_index.html Medium Font class in )
* notes : Set font icon style , You cannot set labels directly , Considering the priority problem , Should be best added to icon-xxx, You must call two class names
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./fonts/iconfont.css">
<style>
/* Set font icon style */
.icon-icon-test1 {
font-size: 50px;
color: red;
}
</style>
</head>
<body>
<!-- Use the class name to call the Font Icon , stay demo_index.html Medium Font class in , Copy the icon class name to be used -->
<div class="iconfont icon-icon-test1"></div>
</body>
</html>2.2.2 Method 2 : Call with code
* notes : You must call the class name iconfont, Paste in the label from Unicode The copied icon corresponds to the code , Don't forget the seal
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./fonts/iconfont.css">
<style>
/* Set font icon style */
.iconfont {
font-size: 50px;
color: red;
}
</style>
</head>
<body>
<!-- Use code to call Font Icon -->
<div class="iconfont"></div>
</body>
</html>2.2.3 Method 3 : Use pseudo elements to call
* notes : When using font icons with pseudo elements , Copy the code of the icon to content in , Add in front. "\", And be sure to write font series (font-family: 'iconfont' To declare fonts )
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./fonts/iconfont.css">
<style>
/* Set font icon style */
div::after {
content: '\e63b';
font-family: 'iconfont';
font-size: 50px;
color: red;
}
</style>
</head>
<body>
<!-- Set the pseudo element to call the Font Icon -->
<div></div>
</body>
</html>边栏推荐
- Sqlserver stored procedures pass array parameters
- 质量体系建设之路的分分合合
- Unity find the coordinates of a point on the circle
- cocos_ Lua loads the file generated by bmfont fnt
- 【acwing】528. cheese
- Out and ref functions of unity
- Lua wechat avatar URL
- Flutter tips: various fancy nesting of listview and pageview
- Group counting notes (1) - check code, original complement multiplication and division calculation, floating point calculation
- SQLServer 存储过程传递数组参数
猜你喜欢

Unity3d learning notes

UE4/UE5 虚幻引擎,材质篇,纹理,Compression and Memory压缩和内存

On-off and on-off of quality system construction

Redis has four methods for checking big keys, which are necessary for optimization

【acwing】528. cheese

AutoCAD - workspace settings

django连接数据库报错,这是什么原因

XSS injection

2021 huashubei mathematical modeling idea + reference + paper

【acwing】837. Number of connected block points
随机推荐
【acwing】837. Number of connected block points
SQLServer 存储过程传递数组参数
Thinking of 2022 American College Students' mathematical modeling competition
猿人学第一题
Common database statements in unity
Database under unity
AutoCAD - lengthening
AutoCAD - command repetition, undo and redo
AutoCAD - workspace settings
【acwing】528. cheese
中国针状焦行业发展研究与投资价值报告(2022版)
MySQL audit log archiving
AutoCAD - set layer
AutoCAD - graphic input and output
Wan broadband access technology V EPON Technology
AutoCAD - isometric annotation
MD5 bypass
Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]
#775 Div.1 C. Tyler and Strings 组合数学
UE4/UE5 虚幻引擎,材质篇,纹理,Compression and Memory压缩和内存


