0
我已經做了一些研究,看起來如果你使用不同的字體來表示你的sIFR字體的粗體和斜體變體(而不是讓Flash用B和I按鍵來僞造它),那麼你有將字體包含在您的SWF中,然後編寫如下代碼:如何告訴sIFR 3使用粗體,斜體等不同的字體?
sIFR.replace(sentinel, {
selector: '.intro p',
css: [
'.sIFR-root { font-family: "Sentinel-Medium"; }',
'strong { font-family: "Sentinel-Bold"; }',
'em { font-family: Sentinel-MediumItalic; }',
'a { color: #0000ff; }',
'a:hover { color: #ff0000; }'
]
});
當我這樣做時,閃存電影出現空白。我猜這只是我的代碼的語法問題。有什麼建議麼?
更新:我設法使用下面的代碼得到這個工作主要是(demo page),但我不能讓嵌套樣式的正常工作。例如,我將em文本轉換爲紅色,並將強壯的文本轉換爲藍色 - 但是,如果我嘗試將em文本設置爲強到紫色,它會將所有ems更改爲紫色。
sIFR.replace(sentinel, {
selector: '.sifr-test',
css: [
'.sIFR-root { font-family: "Sentinel Medium"; }',
'strong { font-family: "Sentinel Bold"; font-weight: normal; color: #6666ff; }',
'em { font-family: Sentinel Medium Italic; font-style: normal; color: #ff6666; }',
'strong em { font-family: Sentinel Semibold Italic; font-weight: normal; font-style: normal; color: #ff66ff; }',
'a { color: #0000ff; }',
'a:hover { color: #ff0000; }'
]
});