简体   繁体   English

在 css 中使用自定义字体 在 React 应用程序中使用 zip 文件

[英]using custom font in css using zip file in react application

I have to use custom font in my website.我必须在我的网站上使用custom font

I am using font-family: 'barclays-regular' but it is not reflecting.我正在使用font-family: 'barclays-regular'但它没有反映。 so now they have provided barclays-font.zip for font and said use .woff format.所以现在他们为字体提供了barclays-font.zip并说使用.woff格式。 I dont know how to use .zip file and .woff in our css .我不知道如何在我们的css中使用.zip文件和.woff how to do it?怎么做? any suggestions or link would be helpful.任何建议或链接都会有所帮助。

I am using these font in our react app .我在我们的react app中使用这些字体。

You can load custom fonts using @font-face .您可以使用@font-face加载自定义 fonts。

This article shows really well how to do this. 这篇文章很好地展示了如何做到这一点。

Add the font to your project and reference it inside your.css file to be able to use it.将字体添加到您的项目并在您的 .css 文件中引用它以便能够使用它。

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

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