html如何导入字体样式表,导入html字体及其样式变体?
我在我的網站中實施名為Roboto的谷歌字體。導入html字體及其樣式變體?
我需要2種類型:bold和regular。
所以我檢查兩種類型,并按下下載按鈕:
但在下載的RAR文件我得到了所有的字體樣式(也者,我沒有選擇):
無論如何,我想考經常字體:(字體現在在我的網站,并沒有從谷歌加載)。
(我使用字體轉換器(http://www.font2web.com/)的其他擴展類型(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; }
問:
假設我想將Roboto bold樣式應用于div。
我應該做這樣的:
div {
font-family: 'Roboto', sans-serif;
font-weight:bold
}
或應該怎么做這個(從頭再來......)
@font-face {
font-family: 'Roboto-bold';
src: url('/font-face/Regular/Roboto-bold.eot'); /* IE9 Compat Modes */
...
}
然后
div { font-family: 'Roboto-bold', sans-serif; }
總結
以上是生活随笔為你收集整理的html如何导入字体样式表,导入html字体及其样式变体?的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: mysql sqlyog讲解_MySQL
- 下一篇: superviseddescent (S
