当前位置: 首页 > 网络学院 > 网页制作基础教程 > CSS > CSS font-family属性

CSS
CSS2 Aural
CSS 单位
CSS 颜色
CSS 颜色值
CSS 颜色名称
CSS 编码与组织技巧
CSS 模块化设计思路
CSS完美兼容IE6/IE7/FF的通用方法
CSS @ Ten: 下一个重要的东西

CSS font-family属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 407 ::
收藏到网摘: n/a

The font-family property is a prioritized list of font family names and/or generic family names for an element. The browser will use the first value it recognizes.
font-family 属性可以为元素指定一列可用字体(可以是一个系列的,也可以是一般性的),并按优先次序排列。浏览器会依次识别,并使用它可识别的第一个值(字体名)

There are two types of font-family values:
下面是两种类型的font-family值:

  • family-name: The name of a font-family, like "times", "courier", "arial", etc.
    family-name:一个字体系列的名称,比如"times", "courier", "arial",等等
  • generic-family: The name of a generic-family, like "serif", "sans-serif", "cursive", "fantasy", "monospace".
    generic-family:字体的一般性名称,比如"serif", "sans-serif", "cursive", "fantasy", "monospace"

Note: Separate each value with a comma, and always offer a generic-family name as the last alternative.
注意:用逗号来分隔每一个值,最好在最后有一个一般性(常用)字体名称。

Note: If a family-name contains white-space, it should be quoted. Single quotes must be used when using the "style" attribute in  HTML.
注意:如果family-name的值有包含空格,那么应该使用双引号。如果是在HTML中的"style"里发生这类情况则得使用单引号。

Inherited: Yes
继承性:是

举例

body
{
font-family: courier, serif
}

p
{
font-family: arial, "lucida console", sans-serif
}

<p style="font-family: arial, 'lucida console', sans-serif">

可用值

描述
family-name
generic-family
A prioritized list of font family names and/or generic family names for an element
为一个(文本)元素指定字体名称或归属名称列表(区分优先级,即:写在前面的字体/归属优先级高)

评论 (0) All

登陆 | 还没注册?