我正在使用this service在我的CSS中創建@font-face
規則。我所做的是創建了兩個規則,一個是正常重量字體,另一個是粗體重版本。像這樣:如果在CSS中使用備用字體,是否可以使用觸發器?
@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'
我遂作出上述整體的字體爲我的網站的默認回宋體,像這樣:
body
{
font-family: "CenturyGothicRegular", Verdana;
font-size: 14px;
}
並取得了一點規則<strong>
使,而不是使體重正常大膽的版本(這似乎只是舒展它),大膽重量的版本將被使用:
strong
{
font-weight: normal;
font-family: 'CenturyGothicBold';
}
一個問題,我可以預見這裏要說的是,如果字體已默認爲宋體,黑體將不是b電子禮物。
有沒有一種方法可以爲<strong>
指定一組新規則,只有在字體默認爲Verdana時才適用?
@marty將無法正常工作:讓我知道這是否需要更多解釋。 – tw16
看起來不錯,給我一個機會來實現這個,我會回到你身邊:) – Marty
兩個字。 http://29.media.tumblr.com/tumblr_lopyvvDXoi1qm5hblo1_500.jpg – Joonas