之前我们要是想使用漂亮的字体只能使用图片字体图片,即制作过程偏慢,用户体验也不够好,对于计算机的加在也是一种负荷,现在css3为我们提供了新的自定义字体属性: @font-face,不但使用简单,而且几乎能解决了我们之前的所有问题。
先上代码:
css3自定义字体@font-face{
font-family:myFont;
src:url('The Heart of Everything Demo.ttf'),url('Sansation_Light.eto');
}
@font-face{
font-family:myFont;
src:url('The Heart of Everything Demo.ttf'),url('Sansation_Bold.eot');
}
div{font-family:myFont;}
百度一下,beautiful你就知道。myFont百度一下,你就知道。how are you!