從一開始我就需要說我知道我所要做的不是「正確的方式」,但我正在拼命工作的客戶需要這個特定的字體。自定義字體顯示很奇怪
因此,我需要在客戶的網站上使用VOGUE使用的確切字體。所以我拿了.eot & .ttf並上傳到我的服務器上。然後,我添加CSS定義:
/*fonts fonts for IE*/
@font-face {
font-family: VogueDidot;
src: url('font/FBDidotL-Regular.eot') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "VogueDidot Light";
src: url('font/FBDidotL-Light.eot') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
/*fonts for other browsers*/
@font-face {
font-family: VogueDidot;
src: url('font/FBDidotL-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "VogueDidot Light";
src: url('font/FBDidotL-Light.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
而對於我的元素的CSS是:
.post h1 {
display: block;
height: 100%;
font-family: VogueDidot;
font-size: 55px;
text-transform: uppercase;
overflow: hidden;
line-height: 58px;
}
而且,通常情況下,我期望看到的一切工作就像一個魅力。
但它不是...
下面是它看起來應該像:
這就是它的外觀在我的網站:
任何想法?
你有鏈接嗎?你有沒有在該頁面上的任何iframe?對我來說,造成同樣的問題.... – hjuster 2013-03-23 13:55:48
你會想使用一個很好的字體轉換器,所以你支持所有主流瀏覽器。嘗試fontsquirrel.com – 2013-03-23 14:04:59
@hjuster不幸的是我現在在本地服務器上:( – 2013-03-23 19:54:56