简体   繁体   中英

css font family code not working for cusotom text

i want to use a custom font for my website but it's not working.

font name "Road_Rage" link: [road rage font link][1]

[1]:

 @font-face { font-family: 'road'; src: url('https://youssef-habchi.com/Emb/Road-Rage/Road_Rage.woff'); font-style: normal; } p{ font-family: 'road'; }
 <p> this is your text </p>

please help me.

Use True Type Font(TTF)

https://www.dafont.com/road-rage.font

Hope this helps

I suspect you running into a cross origin (CORS) problem.

I get this: 在此处输入图像描述

if I run this code from my server - ie the font file is on the same domain:

<style>
    @font-face {
    font-family: 'road';
    src: url('Road_Rage.woff');
    font-style: normal;
    }
p{
    font-family: 'road';
}
</style>
<p>  this is your text </p

But I get it in Times New Roman (my default) if I try to serve the font from your given url.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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