我有一个 HTML 页面,其中包含使用 CSS 定义的各种font-styles,如、normal、bold等。我想为每个 使用单独的字体,比如for ,for等。我使用导入字体,比如,italicsobliquefont-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正文中所有 s 的样式吗?我的意思是如果我分配font-style: italic或分配font-weight: bold给一个元素,会使用斜体字体还是粗体字体?或者我应该怎么做才能实现这一点,这样如果我使用font-weight: bold任何元素,myboldfont.woff都应该使用。