zoukankan      html  css  js  c++  java
  • 自定义字体

    第一步,在中引入字体并给名字取一个合适的名字,如下
    
    @font-face {
        /* font-properties */
        font-family: pictos;
        src:url('pictos/pictos-web.woff'),  
        url('pictos/pictos-web.ttf'),
        url('pictos/pictos-web.eot'); /* IE9 */
    }
    font-family定义字体的名字,接下来的src是加载字体文件的位置,之所有有多个url就是因为浏览器兼容问题。
    
    第二步,使用刚刚定义的字体,如下
    
    div {
        font-family: pictos;
    }
    
    具体例子请查看http://caniuse.sinaapp.com/html/demos/fontface/index.html.
    @font-face的浏览器兼容性请查看http://caniuse.sinaapp.com/html/item/fontface/index.html


  • 相关阅读:
    py 5.11
    py 5.10
    py 5.9
    py 5.8
    python 5.7
    python 5.4
    python 5.3
    python 5.2
    python 4.28
    python 4.27
  • 原文地址:https://www.cnblogs.com/-CLAY-/p/font-family.html
Copyright © 2011-2022 走看看