Web front-end custom font implementation

Source: Internet
Author: User

Different browser support for font files is not the same here only the support TTF file format browser such as the implementation of Google

1. The new HTML file code is as follows

2. Under the same directory, create a new CSS file named Font.css

3. Find the TTF file for the font you need, such as Singlemalta.ttf

4. Use the @font-face module to refer a custom font to your project

@font-face is written in CSS as follows

Here the URL path is written with an absolute path

5. We can see that our custom font is called Firstfont, and this custom font is useful in the H1 style of the 1.

6. Effects

Add: If the browser needs to use this font in other format files can be clicked on this URL to upload your TTF format files can be converted to other formats of the other browser use, when the introduction of multiple text paths in SRC, the browser may only recognize the last path

Web front-end custom font implementation

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.