Skip to content

Font face

Inju Michorius edited this page May 17, 2021 · 2 revisions

Usually when i want to work with a custom font I go to Google Fonts, copy the font link and put it in my html head. This time, I wanted a different font which was not avaiable on Google Fonts. After doing some research on custom fonts I found out about font-face. It's really simple. You need to download the font zip and extract it. Now you should have an installable .otf or .ttf file. Put this in your project's folder and link to the font using this code in css:

@font-face {
    font-family: runyTunes;
    src: url('./RunyTunesRevisitedNF.otf');
}

It's best practise to put this on the top of your css file, since you want to declare it before using it. You can now use this font by adding it's given name. Congrats!

header h1 {
    font-family: 'runyTunes';
}

Weeks

Week 1 📕

Week 2 📙

CSS Techniques

CSS variables 🧠

Font-face 👁‍🗨

Fonts 🅰️

Keyframes 🥳

Custom everything!

Favicon 🌆

Cursor 🖱️

Scrollbar ⌨️

Selection 🧲

Clone this wiki locally