2017-07-08 31 views

回答

4

你必須在你的css中下載字體文件和delcare字體。 你可以檢查www.w3schools.com瞭解更多詳情。這裏有一個例子:

@font-face { 
    font-family: Montserrat; 
    src: url("./fonts/Montserrat-Regular.otf"); 
    font-weight: normal; 
    font-style: normal; 
}@font-face { 
    font-family: Montserrat; 
    src: url("./fonts/Montserrat-Bold.otf"); 
    font-weight: bold; 
    font-style: normal; 
}@font-face { 
    font-family: Montserrat Light; 
    src: url("./fonts/Montserrat-Light.otf"); 
    font-weight: normal; 
    font-style: normal; 
}@font-face { 
    font-family: Montserrat Thin; 
    src: url("./fonts/Montserrat-Thin.otf"); 
    font-weight: normal; 
    font-style: normal; 
}@font-face { 
    font-family: Montserrat Medium; 
    src: url("./fonts/Montserrat-Medium.otf"); 
    font-weight: normal; 
    font-style: normal; 
}@font-face { 
    font-family: Montserrat SemiBold; 
    src: url("./fonts/Montserrat-SemiBold.otf"); 
    font-weight: normal; 
    font-style: normal; 
} 
+1

請注意,您將需要多種格式作爲答案狀態以支持不同的瀏覽器。假設你沒有這些,你可以使用像[Transfonter](https://transfonter.org/)這樣的服務爲你創建它們(以及必要的CSS)。 –

+1

也你應該搜索woff格式或使用一些軟件來使它... otf和ttf不支持IE直到EDGE – Wordica

相關問題