html中设置字体的属性:font、font-family、font-size、font-style、font-variant、font-weight、“@font-face”、font-size-adjust、font-stretch。
本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。
字体属性定义字体,加粗,大小,文字样式。
html中设置字体的属性
属性 说明 font 在一个声明中设置所有字体属性 font-family 规定文本的字体系列 font-size 规定文本的字体尺寸 font-style 规定文本的字体样式 font-variant 规定文本的字体样式。设置小型大写字母的字体显示文本,这意味着所有的小写字母均会被转换为大写,但是所有使用小型大写字体的字母与其余文本相比,其字体尺寸更小。 font-weight 规定字体的粗细 @font-face 一个规则,允许网站下载并使用其他超过"Web- safe"字体的字体 font-size-adjust 为元素规定 aspect 值。为某个元素规定一个 aspect 值,这样就可以保持首选字体的 x-height。 font-stretch 收缩或拉伸当前的字体系列。对当前的 font-family 进行伸缩变形。所有主流浏览器都不支持。扩展资料:
在HTML/CSS中,有两种类型的字体系列名称:
通用字体系列 - 拥有相似外观的字体系统组合(如 "Serif" 或 "Monospace")
特定字体系列 - 一个特定的字体系列(如 "Times" 或 "Courier")
Generic family 字体系列 说明 Serif Times New Roman
Georgia Serif字体中字符在行的末端拥有额外的装饰 Sans-serif Arial
Verdana "Sans"是指无 - 这些字体在末端没有额外的装饰 Monospace Courier New
Lucida Console 所有的等宽字符具有相同的宽度font-family 属性应该设置几个字体名称作为一种"后备"机制,如果浏览器不支持第一种字体,他将尝试下一种字体。
注意: 如果字体系列的名称超过一个字,它必须用引号,如Font Family:"宋体"。
多个字体系列是用一个逗号分隔指明:
p{font-family:"Times New Roman", Times, serif;}下面是一些常用的字体组合,通用的字体系列。
Serif 字体
字体 文本示例 Georgia, serifThis is a heading
This is a paragraph
"Palatino Linotype", "Book Antiqua", Palatino, serifThis is a heading
This is a paragraph
"Times New Roman", Times, serifThis is a heading
This is a paragraph
sans - serif字体
字体 文本示例 Arial, Helvetica, sans-serifThis is a heading
This is a paragraph
Arial Black, Gadget, sans-serifThis is a heading
This is a paragraph
"Comic Sans MS", cursive, sans-serifThis is a heading
This is a paragraph
Impact, Charcoal, sans-serifThis is a heading
This is a paragraph
"Lucida Sans Unicode", "Lucida Grande", sans-serifThis is a heading
This is a paragraph
Tahoma, Geneva, sans-serifThis is a heading
This is a paragraph
"Trebuchet MS", Helvetica, sans-serifThis is a heading
This is a paragraph
Verdana, Geneva, sans-serifThis is a heading
This is a paragraph
Monospace 字体
字体 文本示例 "Courier New", Courier, monospaceThis is a heading
This is a paragraph
"Lucida Console", Monaco, monospaceThis is a heading
This is a paragraph
(学习视频分享:css视频教程)
以上就是html中设置字体的属性有哪些的详细内容!
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did66580
html中设置字体的属性有哪些
阅读:137次