[英]CSS - @font-face
Is there any problem in the below code?: 下面的代码有什么问题吗?
when I load this font in a web page the font doesn't work. 当我在网页上加载此字体时,该字体不起作用。
@font-face {
font-family: 'yekan';
src: url('http://yekandroidi.persiangig.com/other/ip-address/fonts/byekan-webfont.eot');
src: url('http://yekandroidi.persiangig.com/other/ip-address/fonts/byekan-webfont.eot?#iefix') format('embedded-opentype'),
url('http://yekandroidi.persiangig.com/other/ip-address/fonts/byekan-webfont.woff2') format('woff2'),
url('http://yekandroidi.persiangig.com/other/ip-address/fonts/byekan-webfont.woff') format('woff'),
url('http://yekandroidi.persiangig.com/other/ip-address/fonts/byekan-webfont.ttf') format('truetype'),
url('http://yekandroidi.persiangig.com/other/ip-address/fonts/byekan-webfont.svg#yekan') format('svg');
font-weight: normal;
font-style: normal;
}
p {
font-family: yekan; /*nothing appear*/
}
Font from origin ' http://yekandroidi.persiangig.com ' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource 跨源资源共享策略已阻止从源站点' http://yekandroidi.persiangig.com '加载字体:所请求的资源上没有'Access-Control-Allow-Origin'标头
Either enable CORS on the server, or use a different URL for accessing the font 在服务器上启用CORS,或使用其他URL访问字体
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.