How do I refer to assets within a CSS file?
I am using Play Framework 2.1.3 (Scala).
@font-face
{
font-family: RockSalt;
src: url('...something.../assets/fonts/MyFont.ttf');
format('truetype');
}
There's nothing magic about this topic in Play , just use relative paths to your font files in your CSS file. ie. if you have css
and fonts
folders on the same level it will be:
src: url('../fonts/MyFont.ttf');
if you are using default route for assets it can be also path that is relative to app's root:
src: url('/assets/fonts/MyFont.ttf');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With