开发者

Error while using the custom fonts in css

开发者 https://www.devze.com 2023-02-28 22:08 出处:网络
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

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

精彩评论

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