The new font reference can be obtained by running locally, put it on the server to report 404, and get 404

Source: Internet
Author: User

The new font reference can be obtained by running locally, put it on the server to report 404, and get 404

Background: Make a mobile phone page and use a new font (). The ui will give me an otf-format font file, which can be referenced locally

@ Font-face {font-family: ' '; src: url (@ (Url. Content ("~ ") Assets/fonts/font-zzgf.otf );}

Problem: there is no problem in local operation. The font can be properly displayed, but the Error 404 is reported on the server. At first, I thought it was a problem with my path. I checked it several times and found that there was no problem with the path, the name is correct.

Solution: Baidu finally found that the iis does not recognize the otf file by default.

Open iis, find the deployed website, click the MIME type, and click Add new type on the right.

 

 

 

Click OK to refresh the page.

 

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.