Css-icon icons (icon font)

Source: Internet
Author: User
Tags italic font

1. Concept


This little red dot is an icon, and the icon is actually a font in CSS.

2. Why is an icon that is essentially a font?

2.1 Images increase the size of the total file.
2.2 Images add additional HTTP requests, greatly reducing the performance of the Web page.
2.3 Images cannot be scaled much, as the image zooms in and out and is distorted.

3. Advantages of font icons

3.1 You can do things like pictures, change the transparency, the degree of rotation, etc.
3.2 The essence is the text, can change the color very casually, produces the shadow, the transparency effect and so on
3.3 Smaller, portable information not cut
3.4 Almost all browsers supported
3.5 for mobile device-friendly

4. Process of using font icons

website See bookmarks, art---icons

5. Font Introduction to HTML

With https://icomoon.io/#home为例
Click the Icomoon App in the top right corner


Put the Fonts folder in the downloaded package into our project
declaring fonts in HTML

@font-face {  font-family: ‘icomoon‘;  src:  url(‘fonts/icomoon.eot?7kkyc2‘);  src:  url(‘fonts/icomoon.eot?7kkyc2#iefix‘) format(‘embedded-opentype‘),    url(‘fonts/icomoon.ttf?7kkyc2‘) format(‘truetype‘),    url(‘fonts/icomoon.woff?7kkyc2‘) format(‘woff‘),    url(‘fonts/icomoon.svg?7kkyc2#icomoon‘) format(‘svg‘);  font-weight: normal;  font-style: normal;}

Use Fonts for boxes

span {        font-family: "icomoon";    }

Add structure inside the box

span::before {         content: "\e900";    }或者  这个框框是从下载来的zip包中的demo.html里面找的,复制就可以<span>?</span>  
Example 1.
<!     DOCTYPE html>

Label I,span,em,button can also be done

6. Append the new icon to the original font library

If the original font icon in the work is not enough, we need to add a new font icon, but the original can not be deleted, continue to use, at this time we need to do this
The Selection.json in the compressed package from the new upload, and then, select the new icon you want to download the package from the new, replace the original file.

7. There are other ways to use the icon, not discussed

Css-icon icons (icon font)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.