我正在使用这项服务在我的CSS中创建@font-face
规则。我的做法是创建了两个规则,一个用于普通字重的字体,另一个用于粗体版本。示例如下:
@font-face
{
font-family: 'CenturyGothicRegular';
src: url('/static/fonts/gothic_2-webfont.eot');
src: url('/static/fonts/gothic_2-webfont.eot?#iefix') format('embedded-opentype'),
url('/static/fonts/gothic_2-webfont.woff') format('woff'),
url('/static/fonts/gothic_2-webfont.ttf') format('truetype'),
url('/static/fonts/gothic_2-webfont.svg#CenturyGothicRegular') format('svg');
font-weight: normal;
font-style: normal;
}
... and another for 'CenturyGothicBold'
然后我将我的网站的整体字体设置为默认的Verdana,像这样:
body
{
font-family: "CenturyGothicRegular", Verdana;
font-size: 14px;
}
我制定了一个小规则,针对<strong>
标签,不是将普通字体加粗(这似乎只会拉伸它),而是使用粗体字体版本:
strong
{
font-weight: normal;
font-family: 'CenturyGothicBold';
}
我可以预见的一个问题是,如果字体默认为Verdana,则不会显示粗体。
是否有一种方法可以指定一个新的规则集,仅在字体默认为Verdana时应用于标签?