简体   繁体   English

如何更改此字体?

[英]How can I change this font?

i have this template to edit and i want to change the font here's what i have 我有这个模板可以编辑,我想更改字体,这就是我拥有的

@import url(font-awesome.min.css);
@import url(https://fonts.googleapis.com/css?family=Raleway:400,700);

i want to use this font: https://fonts.google.com/specimen/Playfair+Display?selection.family=Playfair+Display 我想使用这种字体: https : //fonts.google.com/specimen/Playfair+Display?selection.family=Playfair+Display

then i have like five places in the css code where the it shows 然后我在css代码中有五个位置,它显示了

  font-family: FontAwesome;

what i did was i downloaded the PlayfairDisplay and pasted in the "font" folder, then i changed all the "font-family:" to the name of the new font, but that did not change anything.. am i missing something? 我所做的是我下载了PlayfairDisplay并粘贴到“字体”文件夹中,然后将所有“字体家族:”更改为新字体的名称,但这并没有改变任何内容。

If you want to use font files instead of the google import, you will have to use @font-face in css and point it to the font file. 如果要使用字体文件而不是Google导入,则必须在CSS中使用@ font-face并将其指向字体文件。 For example: 例如:

@font-face {
font-family: your font name;
src: url(sansation_light.woff);//add your font file here
}

div {
font-family: myFirstFont;
}

you can refer to the following example from w3 schools for more examples: https://www.w3schools.com/cssref/css3_pr_font-face_rule.asp 您可以从w3学校参考以下示例以获取更多示例: https : //www.w3schools.com/cssref/css3_pr_font-face_rule.asp

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

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