Understanding Relative Paths on CSS

Hi, I am on the typography part of the module. I am attempting to implement the CroissantOne-Regular.ttf font-family into my CSS code using @font-face.

I don’t understand whether to write the src as
src: url("./styles/CroissantOne-Regular.ttf") format(truetype)

or

src: url(".../fonts/styles/CroissantOne-Regular.ttf") format(truetype)

Either way, when I click ‘save,’ nothing changes on my screen

Hey @dinnosam

Check if there’s an answer here for you https://developer.mozilla.org/en-US/docs/Web/CSS/url()

Also make sure your path is consistent when you try the different variations:

/fonts/styles/CroissantOne-Regular.ttf
!=
./styles/CroissantOne-Regular.ttf

1 Like