Font-family not working properly on live server

2019-09-16 16:33发布

问题:

I am using font-family "angelina". Its working properly on local server. But its not working on live server. It also working on live server just only on my computer. But its not working on any other computers. I check it in all browsers on other computers but its not working. I am using CSS code like this

@font-face {
font-family: MyCustomFont;
src: url("ANGELINA.eot") /* EOT file for IE */
}
@font-face {
 font-family: MyCustomFont;
 src: url("ANGELINA.TTF") /* TTF file for CSS3 browsers */
}
.test_font{
    font-family: angelina;
    font-size: 36px;
    font-weight: bold;
}

回答1:

You need to have all kinds of font extensions on server to support all browsers.

@font-face { font-family: MyCustomFont;

src: url('ANGELINA.eot');
src: url('ANGELINA.eot?') format('☺'),
     url('ANGELINA.woff') format('woff'),
     url('ANGELINA.ttf') format('truetype'),
     url('ANGELINA.svg#webfontssbCkuz5') format('svg');

}

You can find all font extensions on this site http://www.google.com/webfonts



回答2:

It supposed to be:

@font-face {
font-family: angelina;
src: url("ANGELINA.eot") /* EOT file for IE */
}
@font-face {
 font-family: angelina;
 src: url("ANGELINA.TTF") /* TTF file for CSS3 browsers */
}

if you want to call font-family: angelina;