
css @font-face属性
指定名为"myFirstFont"的字体,并指定在那里能够找到它的URL
@font-face { font-family: myFirstFont; src: url('Sansation_Light.ttf'), url('Sansation_Light.eot'); /* IE9 */ }
css @font-face属性属性定义及运用说明
@font-face划定规矩,网页设计师再也没必要运用的"web-safe"的字体之一。
字体的称号,font - face划定规矩
font-family: myFirstFont
字体文件包含在您的服务器上的某个处所,参考CSS
src: url('Sansation_Light.ttf')
假如字体文件是在差别的位置,请运用完全的URL
src: url('http://www.w3cschool.css/css3/Sansation_Light.ttf')
如今预备运用该字体,下面是怎样运用它所有的div元素的一个例子
div { font-family: myFirstFont; }
语法
@font-face { font-properties }
以下实例为在div中运用的字体:
div { font-family: myFirstFont; }
语法
@font-face { font-properties }
以上就是css @font-face属性怎样用的细致内容,更多请关注ki4网别的相干文章!