我呼籲project
和目錄在其中,我有目錄html
,assets
和javascript
directory
有目錄fonts
和css
.The css
目錄中有一個名爲css文件.The資產typography.css
。字體目錄中包含我正在使用的所有字體。我有一個文件typography.html
。要使用我使用這個代碼的字體內typography.css
這是正確鏈接/在我的html中引用file.However在代碼裏typography.css
@fontface CSS字體路徑似乎並沒有工作
@font-face {
font-family: "LatoLight";
src: url('../fonts/lato-light-webfont.eot') format("embedded-opentype"), url('../fonts/lato-light-webfont.woff') format("woff"), url('../fonts/lato-light-webfont.ttf') format("truetype"), url('../fonts/lato-light-webfont.svg') format("svg");
}
h1{ font-family: LatoLight !important; }
不會產生預期的result.I正在使用Twitter的引導爲什麼說這不工作?
您是否嘗試將字體文件直接放在css文件夾中並將其鏈接到那裏以查看是否存在除可能的目錄問題以外的其他任何問題? –
是的,我也這樣做了,但也失敗了。但是,當我在我的typography.html文件中使用內聯樣式並直接在html內添加所有字體時,它可以工作,但我需要將字體放在字體目錄中。 –
你使用什麼瀏覽器? –