-1

このcssを使用していますが、正しく機能していません。

@font-face {
 font-family: OpenSans-Bold;
 src: url('../design_images/font/OpenSans-Bold.eot'); /* EOT file for IE */
 font-weight:normal;
 font-style:normal;

}
@font-face {
 font-family: OpenSans-Regular;
 src:url('font/OpenSans-Regular.eot');
 font-weight:normal;
 font-style:normal;

}

@font-face {
 font-family: Oswald-Regular;
 src: url('font/Oswald-Regular.eot');
 font-weight:normal;
 font-style:normal;

}
@font-face {
 font-family:OpenSans-Regular;
 src: url('font/OpenSans-Regular.ttf'); /* TTF file for CSS3 browsers */
 font-weight:normal;
 font-style:normal;
}
@font-face {
 font-family:OpenSans-Bold;
 src: url('font/OpenSans-Bold.ttf');
 font-weight:normal;
 font-style:normal;
}
@font-face {
 font-family: Oswald-Regular;
 src: url('font/Oswald-Regular.otf');
}

.newr {
        font-family:Oswald-Regular;
        font-size:20px;
        font-style:normal;
        font-smooth:Crisp;
        font-weight:normal;
        color:#f9e211;
        text-transform:uppercase;
        margin:21px 0 0 25px;
    }
4

3 に答える 3

2

時々、通常のフォントをWebフォントに変換して、より滑らかできれいに見えるようにし、CSSに次のように追加します。

@font-face {
   font-family: 'ArvoRegular'; 
   src: url('Arvo-Regular-webfont.eot'); 
   src: url('Arvo-Regular-webfont.eot?#iefix') format('embedded-opentype'), 
        url('Arvo-Regular-webfont.woff') format('woff'),
        url('Arvo-Regular-webfont.ttf') format('truetype'), 
        url('Arvo-Regular-webfont.svg#ArvoRegular') format('svg'); 
   font-weight: normal; 
   font-style: normal; 
}

@ font-face Generatorsを検索して、目的のフォントを生成します。

于 2013-02-19T09:58:55.933 に答える
1

これを使って:

@font-face{
   font-family: fontFamilyNameHere ;
   src: url(.eot file path here); /* For IE */
   src: local("fontNameHere"), url(.ttf file path here) format("truetype"); /* non-IE */ 
   font-weight:normal;
   font-style:normal;
}
于 2013-02-19T09:58:48.350 に答える
0

src 属性に 2 つの異なるパスがあるようです。一つは

src: url('../design_images/font/OpenSans-Bold.eot'); /* IE 用の EOT ファイル */

そして他は

src:url('font/OpenSans-Regular.eot');

../design_images/font/1 つのパスが にリンクし、もう1 つのパスが にリンクするのはなぜfont/ですか? ディレクトリ構造によっては、これが問題になる場合があります。私がそれを指摘すると思っただけです。

于 2013-02-19T10:05:05.540 に答える