P粉6271364502023-09-06 17:29:18
Your syntax is:
src: url('some_url'); src: url('other_url');
You just need to redefine the URL of the font in each line. So the browser will only use the last one, and the others will be discarded. The correct basic syntax is:
@font-face { font-family: 'SomeFont'; src: local("SomeFont"), url('//host.tld/SomeFont.woff2') format('woff2'), url('//host.tld/SomeFont.woff') format('woff'), url('//host.tld/SomeFont.ttf') format('truetype'); }
You can include additional font formats if you need to satisfy older browsers.
Note: Changed incorrect format('ttf')
to format('truetype')
, thanks @herrstrietzel