开发者

Error while using the custom fonts in css

While I tried to use custom font for my website through the CSS file, I'm not getting the required font and it shows only the default font. Please Check the css code a开发者_StackOverflow中文版nd let me know if any changes needed :)

@font-face {
    font-family: Myriad Pro;
    src: url('Myriad.ttf');
    }
#voicetext{
    color:#127bb9;
    font-size:16px;
    font-family:"Myriad Pro";
    text-align:center;
    letter-spacing:3px;
}


Unfortunately, it isn't as straight forward as this. For a truly cross-browser solution, you will need to reference more than just the TTF version.

This question: How to embed fonts in HTML? has a full list, and links to Paul Irish's "Bulletproof web fonts" blog entry that caters for all the browser quirks.

If you're in a hurry, and not interested in the specifics, FontSquirrel's Bulletproof @font-face generator seems to utilize the hints from the blog post.


My first guess is probably that you've uploaded your font file at the wrong place. Currently, you'll need a Myriad.ttf file in the same directory as your css file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜