How to use fonts from local folder?
For some reason I can't figure this out.
First one works, but I can't make "Regular" one work...
I put "font-family:'SpartanRegular', sans-serif;" on element I want to have that font on, but nothing.
14 Replies
Try adding
./
in front of the URLs: url('./spartan-cufonfonts/Spartan-Bold.ttf')
That indicates a relative URL instead of an absolute URLFolder with fonts is next to css file
so /spartan-cufonfonts should work?
./
Did it but nothing
Dot-slash, not just slash
@cvanilla13eck Still nothing 😦 even with ./
Damn
I’m not that familiar with how to use font-face. Let’s ask Kevin:
https://youtu.be/zK-yy6C2Nck
Kevin Powell
YouTube
Self-hosting fonts explained (including Google fonts) // @font-face...
Google fonts are great, but often self-hosting them is a better choice, or if you’re in parts of Europe, it might be your only choice, so in this video I take a look at the basics of how to self-host fonts.
🔗 Links
✅ Font Squirrel Webfont Generator: https://www.fontsquirrel.com/tools/webfont-generator
⌚ Timestamps
00:00 - Introduction
01:05 -...
Ohhh he has one
nice
Will check it out! Thanks
There’s also this one:
https://youtu.be/KzqQXDbDvus
Kevin Powell
YouTube
How to host your own fonts made simple
The first 1000 people to use the link will get a free trial of Skillshare Premium Membership: https://skl.sh/kevinpowell01211
Hosting your own fonts is a good way to improve the performance of your site, and in this video we look at how to do it with @font-face including where you can find fonts from, and how to set them up to make your life a...
since one is working and other doesn't the path can't be wrong can it ?
Get your logic outta here, !
nope. URLs in CSS are relative to the .css file,
either use
./spartan.woff
or just spartan.woff
Anything that starth with a /
is an absolute URL that has its origin in the document root (project folder).