Nico Huysamen
Nico Huysamen

Reputation: 10427

Can relative paths be used for @font-face src?

When using @font-face in CSS to use custom fonts, can I specify a relative path for the fonts. Say I have the following structure:

WebContent
 - css
    |- style01.css
    |- style02.css
    |- ...
 - fonts
    |- font01.ttf
    |- font01.ttf
    |- ...
 - images
    |- ...
 - js
    |- ...
 - index.html
 - *.html

Can I specify something similar to:

@font-face {
   font-family: 'font one';
   src: url('../fonts/font01.ttf');
}

since the above does not seem to work.

Upvotes: 6

Views: 9656

Answers (1)

Nico Huysamen
Nico Huysamen

Reputation: 10427

Seems the issue was that it doesn't like the single quotes ' around the name.

Upvotes: 5

Related Questions