开发者

@font-face is not working

开发者 https://www.devze.com 2023-01-27 16:59 出处:网络
I am having the hardest time getting @font-face to load for this site. Does any one know what is going on?

I am having the hardest time getting @font-face to load for this site. Does any one know what is going on?

I tried using the css from font squirrel but that didn't work either so I tried a simpler code hoping that would work, but no luck so far.

OLDER CSS (did not work)

@font-face {
 font-family: 'CartoGothicStdBold';
 src: url('CartoGothicStd-Bold-webfont.eot');
 src: local('☺'), url('CartoGothicStd-Bold-webfont.woff') format('woff'), url('CartoGothicStd-Bold-webfont.ttf') format('truetype'), url('CartoGothicStd-Bold-webfont.svg#webfontuvgRkG9V') format('svg');
 font-weight: normal;
 font-style: normal;
}

NEWER CSS (stil开发者_StackOverflowl doesn't work)

@font-face {
font-family: 'CartoGothicStdBold'; 
src: url(css/fonts/CartoGothicStd-Bold.otf) format("opentype");
}


.b-nb {
 float: left;
 width: 100%;
 font-size: 1.25em;
 color: grey;
 font-family:'CartoGothicStdBold', serif;
}

I am testing it here: http://drewlepp.com/testing/laa/LAA%20studio/index.html

Thanks!!!!


Old question, but i'll point you to the correct answer anyway (in case someone else stumbles on this)

The older CSS looks fine to me. But if you're using IE9 and using private font, you'll see an error in IE9's console. So you need to do what this bloke has done here: @font-face works in IE8 but not IE9


@font-face {
    font-family: 'Tangerine';
    src: local('Tangerine'), url('/fonts/Tangerine_Regular.ttf') format('truetype');
}

try this. I am using like that in my own site

0

精彩评论

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