Bootstrap font icon (glyphicons)

Source: Internet
Author: User

Bootstrap font icon (glyphicons)

 

Font icon:Font icons are the font of icons used in Web projects. The font icon is in the downloaded Bootstrap fonts folder.
.glyphicon {  position: relative;  top: 1px;  display: inline-block;  font-family: 'Glyphicons Halflings';  -webkit-font-smoothing: antialiased;  font-style: normal;  font-weight: normal;  line-height: 1;  -moz-osx-font-smoothing: grayscale;}
 

. Glyphicon class declares the relative position of a 1px offset from the top, which is displayed as inline-block, indicating the font, specifying the font-style and

Font-weight is normal, and the row height is set to 1. In addition, use-webkit-font-smoothing: antialiased and

-Moz-osx-font-smoothing: grayscale; achieve cross-browser consistency.

About-webkit-font-smoothing and-moz-osx-font-smoothing:

-Webkit-font-smoothing attribute. This attribute can make the font on the page more clear and comfortable.

None ------ better for low-pixel text

Subpixel-antialiased ------ Default Value

Antialiased ------ good anti-aliasing

Auto

Inherit ------ inherit the parent Element

Initial

-Moz-osx-font-smoothingAttributeAmong them,-osx-indicates that this is a rare feature enhancement that mozilla has introduced to a specific operating system. Due to the lack of documentation, the values currently known are:
Grayscale ------ good anti-aliasing
Auto ------ Default Valueinherit                         ------ Inheritance
 
Bootstrap provides 200 font icons, each of which corresponds to a class. In use, we only need to include the glyphicon and the corresponding class.
Usage:

Use with button:

 

  Home Home Home Home Home 

 

Effect:

In the previous example, we have customized the font Icon size and color. Further instructions are provided here. You can change the font Icon size by changing the font size or button size. By setting the color, you can change the font icon color as follows:

 

 Home Home Home 

 

Effect:

We can see that the font icon color can be changed by changing the color of its parent element or span.

Apply text shadow

 

 Home Home Home 

 

For more information, seeFont icon, yesOfficial bootstrap documentation:

 

Related Article

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.