简体   繁体   English

通过@ font-face使用特定字体

[英]Using a specific font by @font-face

my problem is, I want to use a specific font type called (Daniel) which is not supported by google fonts, so I have used (@font-face) and it worked but only for the home page but the other pages which at the site are not working and I can not figure out the reason! 我的问题是,我想使用一种称为(Daniel)的特定字体类型,但Google字体不支持该字体类型,因此我使用了(@ font-face),它只对主页有效,但对其他页面有效网站无法正常工作,我无法找出原因! Would you help me please to solve this problem? 您能帮我解决这个问题吗?

PS This problem is shown only at Mozilla firefox browser and mobile phones, google chrome is going well! PS此问题仅在Mozilla firefox浏览器和手机上显示,google chrome运行良好!

@font-face {
font-family: 'Daniel';
src: url('Daniel.eot');
src: url('Daniel.eot?#iefix') format('embedded-opentype'),
     url('Daniel.woff') format('woff'),
     url('Daniel.ttf') format('truetype'),
     url('Daniel.svg#Daniel') format('svg');
font-weight: normal;
font-style: normal;

} }

and here is the the problem shown at firefox console: 这是firefox控制台上显示的问题: 在此处输入图片说明

Download font file and then place it somewhere in you project directory and use it like this: 下载字体文件,然后将其放在项目目录中的某个位置,并按以下方式使用它:

@font-face {
  font-family: 'Steiner Light';
  font-style: normal;
  font-weight: normal;
  src: local('Steiner Light'), url('../fonts/Steinerlight.woff') format('woff');
}

.body{

  font-family: 'Steiner Light' !important;
  font-size: 20px !important;
  font-weight: 900;
  letter-spacing: 1px;
  color: $orange;

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM