In the morning, I listened to my colleague introduce the icon of icomoon, searched the use case on the Internet, and found that it is really useful. Just select the corresponding icon on the website: https://icomoon.io/app/ , click the font setting, and then click to download. Unzip the downloaded file, then copy the font folder and style.css to the project, and cite the css for future reference
Reprinted the relevant introduction: Reprinted from: http://blog.csdn.net/u013938465/article/details/50680468
Recently, a lot of projects have used font icons. Everyone knows that font icons can be scaled arbitrarily without distortion, and the number of requests is greatly reduced, which is very easy to use. The following will explain how I generate font icons and apply them based on the .svg file provided by the artist.
With the help of an online generator: https://icomoon.io/app/#/select
1. Enter the URL: the main page
2. Create a new atlas
3. Add .svg pictures (you can use ready-made or customized ones)
Use the ready-to-click Add Icons in red on the page...
Use custom drag and drop directly into the atlas to add
4. Generate font file
(1) Select the icon to be generated (free choice)
(2) Click on the bottom: "Generate Font F"
can be named freely
5. After the modification is completed, click Generate Font
Download to zip file:
Use: Put the entire contents of the fonts folder and the style.css file into the corresponding project.
The font can be added by adding the name of the class class generated under the css file to the node corresponding to the html.
Of course, you also need to set font-size to add fonts, and you can also set color to change its color according to the actual situation.
Reprinted from: http://blog.csdn.net/goodgirl1991/article/details/50416974
icomoon icon is an awesome and practical open source icon series, its official website address is https://icomoon.io/icons.html
Well, let's introduce how to apply this series of icons to web pages.
Download selected icomoon icon
Writing web code
- @font-face{
- font-family:‘icomoon’;
- src:url(‘icomoon.eot’);
- src:url(‘font/icomoon.eot?#iefix’) format(‘embedded-opentype’),
- url(‘font/icomoon.woff’) format(‘woff’),
- url(‘font/icomoon.ttf’) format(‘truetype’),
- url(‘font/icomoon.svg#SofiaProLight’) format(‘svg’);
- font-weight:normal;
- font-style:normal;
- }
- <body>
- < div data-icon = “” > </ div > <!–The icon html escape code obtained before is used to specify which icon to add at this tag–>
- <divdata-icon=“”></div>
- </body>
- div:after{<!–:before or :after must be written, otherwise the icon cannot be displayed–>
- font-family:‘icomoon’;
- content : attr (data- icon );<!– here specifies which icon to add to the label–>
- }
Through the above steps, the icon is displayed
In the morning, I listened to my colleague introduce the icon of icomoon, searched the use case on the Internet, and found that it is really useful. Just select the corresponding icon on the website: https://icomoon.io/app/ , click the font setting, and then click to download. Unzip the downloaded file, then copy the font folder and style.css to the project, and cite the css for future reference
Reprinted the relevant introduction: Reprinted from: http://blog.csdn.net/u013938465/article/details/50680468
Recently, a lot of projects have used font icons. Everyone knows that font icons can be scaled arbitrarily without distortion, and the number of requests is greatly reduced, which is very easy to use. The following will explain how I generate font icons and apply them based on the .svg file provided by the artist.
With the help of an online generator: https://icomoon.io/app/#/select
1. Enter the URL: the main page
2. Create a new atlas
3. Add .svg pictures (you can use ready-made or customized ones)
Use the ready-to-click Add Icons in red on the page...
Use custom drag and drop directly into the atlas to add
4. Generate font file
(1) Select the icon to be generated (free choice)
(2) Click on the bottom: "Generate Font F"
can be named freely
5. After the modification is completed, click Generate Font
Download to zip file:
Use: Put the entire contents of the fonts folder and the style.css file into the corresponding project.
The font can be added by adding the name of the class class generated under the css file to the node corresponding to the html.
Of course, you also need to set font-size to add fonts, and you can also set color to change its color according to the actual situation.
Reprinted from: http://blog.csdn.net/goodgirl1991/article/details/50416974
icomoon icon is an awesome and practical open source icon series, its official website address is https://icomoon.io/icons.html
Well, let's introduce how to apply this series of icons to web pages.
Download selected icomoon icon
Writing web code
- @font-face{
- font-family:‘icomoon’;
- src:url(‘icomoon.eot’);
- src:url(‘font/icomoon.eot?#iefix’) format(‘embedded-opentype’),
- url(‘font/icomoon.woff’) format(‘woff’),
- url(‘font/icomoon.ttf’) format(‘truetype’),
- url(‘font/icomoon.svg#SofiaProLight’) format(‘svg’);
- font-weight:normal;
- font-style:normal;
- }
- <body>
- < div data-icon = “” > </ div > <!–The icon html escape code obtained before is used to specify which icon to add at this tag–>
- <divdata-icon=“”></div>
- </body>
- div:after{<!–:before or :after must be written, otherwise the icon cannot be displayed–>
- font-family:‘icomoon’;
- content : attr (data- icon );<!– here specifies which icon to add to the label–>
- }
Through the above steps, the icon is displayed