我試圖找到如何做到這一點,至少this link差點讓我。但她/他正在使用鏈接更改字體。如何將bootstrap.css字體家族HTML更改爲我自己的下載字體
,但我已經用我自己下載的字體font converter(.eot雜項文件.SVG的.ttf .woff .woff2)
,我有style.css
象下面這樣:
/* font converted using font-converter.net. thank you! */
@font-face {
font-family: "CataneoBT-Regular";
src: url("./fonts/07323Cataneo.svg") format("svg"), /* Legacy iOS */
url("./fonts/07323Cataneo.ttf") format("truetype"), /* Safari, Android, iOS */
url("./fonts/07323Cataneo.woff") format("woff"), /* Modern Browsers */
url("./fonts/07323Cataneo.woff2") format("woff2"); /* Modern Browsers */
font-weight: normal;
font-style: normal;
}
這是一塊我bootstrap.css HTML代碼:
html {
font-family: sans-serif;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
我舉的最相似的代碼是:
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix')
format('embedded-opentype'),
url('../fonts/glyphicons-halflings-regular.woff2')
format('woff2'),
url('../fonts/glyphicons-halflings-regular.woff')
format('woff'),
url('../fonts/glyphicons-halflings-regular.ttf')
format('truetype'),
url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular')
format('svg');
}
.glyphicon {
position: relative;
top: 1px;
display: inline-block;
font-family: 'Glyphicons Halflings';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
但據我所知,這個代碼只是爲了顯示一些圖標
我不知道如何代碼更改爲顯示我自己的字體
您是使用編譯的代碼還是源代碼(LESS,SASS)? –
你並不需要包含所有這些字體格式。 Woff足夠好。 http://caniuse.com/#feat=woff –