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

CSS
CSS 介绍
CSS 语法
使用 CSS
CSS 背景
CSS 文字
CSS 字体
CSS 边框
CSS 边距
CSS 填充
CSS 列表
CSS 尺寸
CSS 类别
CSS 定位
CSS 伪类
CSS 伪元素
CSS2 Media类型
CSS 摘要
CSS 实例
CSS2 参考资料
CSS2 打印

CSS font-family属性


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 406 ::
收藏到网摘: 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

登陆 | 还没注册?