html如何导入字体样式表,导入html字体及其样式变体?
我在我的網(wǎng)站中實(shí)施名為Roboto的谷歌字體。導(dǎo)入html字體及其樣式變體?
我需要2種類型:bold和regular。
所以我檢查兩種類型,并按下下載按鈕:
但在下載的RAR文件我得到了所有的字體樣式(也者,我沒有選擇):
無論如何,我想考經(jīng)常字體:(字體現(xiàn)在在我的網(wǎng)站,并沒有從谷歌加載)。
(我使用字體轉(zhuǎn)換器(http://www.font2web.com/)的其他擴(kuò)展類型(EOT,WOFF,SVG))
所以我做:
@font-face {
font-family: 'Roboto';
src: url('/font-face/Regular/Roboto-Regular.eot'); /* IE9 Compat Modes */
src: url('/font-face/Regular/Roboto-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('/font-face/Regular/Roboto-Regular.woff') format('woff'), /* Modern Browsers */
url('/font-face/Regular/Roboto-Regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('/font-face/Regular/Roboto-Regularo.svg#svgFontName') format('svg'); /* Legacy iOS */
}
body { font-family: 'Roboto', sans-serif; }
問:
假設(shè)我想將Roboto bold樣式應(yīng)用于div。
我應(yīng)該做這樣的:
div {
font-family: 'Roboto', sans-serif;
font-weight:bold
}
或應(yīng)該怎么做這個(gè)(從頭再來......)
@font-face {
font-family: 'Roboto-bold';
src: url('/font-face/Regular/Roboto-bold.eot'); /* IE9 Compat Modes */
...
}
然后
div { font-family: 'Roboto-bold', sans-serif; }
總結(jié)
以上是生活随笔為你收集整理的html如何导入字体样式表,导入html字体及其样式变体?的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql sqlyog讲解_MySQL
- 下一篇: superviseddescent (S