Most of the information on the web is said to be in the case of Apache and NG servers, but the basic idea is to add a response header
Scene:
Page reference CSS file:
<link href= "Http://www.tuohuangzu.com/content/Company_v2/register/css/font.css" type= "Text/css" rel= " Stylesheet "/>
Defined in style:
@font-face {
font-family: ' Uninf-icon-usual ';
Src:url (' fonts/uninf-icon-usual.eot?-ny5g1a ');
Src:url (' Fonts/uninf-icon-usual.eot #iefix-ny5g1a ') format (' Embedded-opentype '),
URL (' fonts/uninf-icon-usual.ttf?-ny5g1a ') format (' TrueType '),
URL (' fonts/uninf-icon-usual.woff?-ny5g1a ') format (' Woff '),
URL (' fonts/uninf-icon-usual.svg?-ny5g1a#uninf-icon-usual ') format (' SVG ');
Font-weight:normal;
Font-style:normal;
}
The use of font libraries has led to cross-domain, prompting TTF and Woff to raise cross-domain issues in Firefox
Workaround:
protected voidApplication_BeginRequest (Objectsender, EventArgs e) { varURL =HttpContext.Current.Request.Url.AbsolutePath; if(URL.) LastIndexOf (".", stringcomparison.ordinal) >0) { varstr = URL. Substring (URL. LastIndexOf (".", stringcomparison.ordinal)); if(str = =". TTF"|| str = =". Woff") {HttpContext.Current.Response.AddHeader ("Access-control-allow-origin","*"); } } }
C # Font Library cross-domain resolution