@font-face Handling Special fonts in Web pages

Source: Internet
Author: User

For a front-end, Yan value is justice, a period of time the company's official website was warned of copyright infringement using Microsoft Font (cover face), received instructions to immediately change the entire website font Cheng Siyuan blackbody, although ugly point, but free ah, hurriedly changed up. But one problem is that even if you install the font of the source blackbody locally, the Web page is to be uploaded to the server, the user visits the Web site, their computer does not necessarily have the source font, unless the font is installed on the client computer, the user can not display this font.

① first found in their own native blackbody font files, if not can be downloaded on the Internet;

② Baidu Font-face Generator, according to the above steps, upload the source blackbody file, will generate a variety of format source Blackbody file saved to the local, new folder fonts, save;

③ put fonts files in their own uploaded web site files, create a new fonts.css file, use the @font-face property to customize the font settings, we can freely use the network of custom fonts, for a chestnut ~

1 @font-face{2 font-family:"gufeibai"; Here is our own name for the font3 src:URL ("sourcehansans-regular.woff2") format ("Woff2"),4 URL ("Sourcehansans-regular.woff") format ("Woff"),5 URL ("Sourcehansans-regular.ttf") format ("TrueType"),6 URL ("Sourcehansans-regular.eot") format ("Embedded-opentype"),7 URL ("sourcehansans-regular.svg") format ("SVG"),8 URL ("SOURCEHANSANS-REGULAR.OTF") format ("OpenType");9 Font-weight:Normal;Ten Font-style:Normal; One} A Body{ - Font:15px/1.5 "gufeibai", Arial,sans-serif; - Color:#666; the background:#fff; -}

@font-face Handling Special fonts in Web pages

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.