Mayur
Mayur

Reputation: 3005

How to embed a font in website

I am trying to embed my custom font in my website, got a link folder from http://www.fontsquirrel.com/fontface/generator this site after uploading a font on this site, it gives me this CSS:

@font-face {
    font-family: 'VoltaEFTU-Regular';
    src: url('voltaeftu-regular-webfont.eot');
    src: local('☺'),
    url('voltaeftu-regular-webfont.woff') format('woff'),
    url('voltaeftu-regular-webfont.ttf') format('truetype'),
    url('voltaeftu-regular-webfont.svg#webfonttKmU3jX8') format('svg');
    font-weight: normal;
    font-style: normal;
}

But it's not working on my machines. How can I embed a font in my website?

Thanks Mayur Mate

Upvotes: 3

Views: 3385

Answers (2)

dikamilo
dikamilo

Reputation: 667

@font-face code looks correct, but if you want use this font example in <p> you must use font-family: 'VoltaEFTU-Regular'; in this element. Look into generated demo.html file.

Upvotes: 1

David Wolever
David Wolever

Reputation: 154454

If I were doing it, I would take a look at how the Google Font API works…

Upvotes: 2

Related Questions