I am using a font for my site which is stored under my project folder as fonts and i used this code in css.
my css
@font-face
{
font-family: buddys;
src: url('/fonts/Kristen-ITC-Regular.ttf'),
url('/fonts/Kristen-ITC-Regular.eot'); /* IE9 */
}
its working on localhost while its uploaded to live the font style not apply on my site. How to make it work on live site.
Thanks.
As you're using Visual Studio, you need to set the Build Action for each of your webfonts to 'Content' under properties. If you don't do this, your font files do not get included in the deployment package and never make it to your server.
Also, I would suggest improving your @font-face code in your CSS to include all formats (you can use font squirrel to help with this: http://www.fontsquirrel.com/fontface/generator). Also worth a read is this article on the most compatible code to use: http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/
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