CSS を使用して定義された 、 、 などのさまざまなfont-stylesを含む HTML ページがあります。たとえば、for 、forなど、それぞれに別々のフォントを使用したい。normalbolditalicsobliquefont-stylemyboldfontboldmyitalicsfontitalics@font-face
@font-face {
font-family: "MyNormal";
font-style: normal;
font-weight: normal;
src: url("mynormalfont.woff") format("woff");
}
@font-face {
font-family: "MyBold";
font-style: normal;
font-weight: normal;
src: url("myboldfont.woff") format("woff");
}
@font-face {
font-family: "MyItalics";
font-style: normal;
font-weight: normal;
src: url("myitalicsfont.woff") format("woff");
}
@font-face {
font-family: "MyOblique";
font-style: normal;
font-weight: normal;
src: url("myobliquefont.woff") format("woff");
}
通常、斜体、太字、斜めのフォントをインポートしました。body次のようなスタイリングを定義しました。
body{
font-family: MyNormal, MyBold, MyItalics, MyOblique;
}
font-styleボディ内のすべての のスタイルを定義するには、これで十分ですか? font-style: italicorを要素に割り当てfont-weight: boldた場合、斜体フォントまたは太字フォントが使用されますか? または、これを達成するにはどうすればよいので、font-weight: bold要素に使用する場合は使用するmyboldfont.woff必要があります。