CSS生成字体@font-face

需要本地有字体文件,如:helvetica-light.otf

通过工具自动生成网页字体,如:http://www.fontsquirrel.com/tools/webfont-generator

点击UPLOAD后,再DOWNLOAD

会得到一个目录包,如:helvetica-light

然后CSS里定义,如:

@font-face {
    font-family: 'Helvetica-Light-Light-Italic';
    src: url('helvetica-light/helvetica-Light-webfont.eot');
    src: url('helvetica-light/helvetica-Light-webfont.eot?#iefix') format('embedded-opentype'),
         url('helvetica-light/helvetica-Light-webfont.woff') format('woff'),
         url('helvetica-light/helvetica-Light-webfont.ttf') format('truetype'),
         url('helvetica-light/helvetica-Light-webfont.svg#AlluraRegular') format('svg');
}

body{font-family: 'Helvetica-Light-Light-Italic' }










你可能感兴趣的:(css+div)