利用CSS3 [font-face]自定义网站字体

通过CSS3新增属性Font-face, 网页设计师可以使用任何喜欢的字体,只需要将字体上传到服务器上,从而避免使用图片代替。

支持CSS3 @font-face属性的浏览器有:Safari,Firefox,Chrome,Opera

预览:利用CSS3 [font-face]自定义网站字体

使用方法:

@font-face {font-family: 字体名称; src: url('字体路径');}

CSS代码:

@font-face {font-family: aller-display; src: url('aller-display.ttf');}
div {font-family: aller-display; font-size: 2em;}  

HTML代码:

<div>this is a custom font named aller display</div> 

下载:利用CSS3 [font-face]自定义网站字体

1 Comment

  1. 一米 says:

    找这个字体,找到这里了,嘿嘿。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!:

无觅相关文章插件,快速提升流量

任鸟飞网页设计博客 谜题推理 No.1 Web Design Gallery IndustryIdea LookForDesign AWebGallery Mobile Web Template iDesign Wallpaper Big Funny Picture iPhone Faves iPhone Mobi iPad Faves Android Faves BlackBerry Faves Best Design Magazine All Banner Templates Blog Earn Tips 是谁啊 只爱美人 家乡美 唯美爱 美人衣妆 AutoCAD 2D | Pro/E 3D江苏名企The HTML5 Templates