下载此文档

CSS字体属性.ppt


文档分类:IT计算机 | 页数:约15页 举报非法文档有奖
1/15
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/15 下载此文档
文档列表 文档介绍
CSS字体属性
CSS字体属性
字体名称属性(font-family)
这个属性设定字体名称,如Arial, Tahoma, Courier等。例句如下:
.s1 {font-family:Arial}
看案例:
<html>
<head>
<title>字体名称属性 font-family</title>
<STYLE>
.s1 {font-family:Arial}
.s2 {font-family:Tahoma}
.s3 {font-family:Courier}
.s4 {font-family:Verdana}
.s5 {font-family:"Book Antiqua"}
</STYLE>
</head>
<body>
<p>The font-family value of the text is the browser default font.</p>
<p class = "s1">The fon-family value of the text is "Arial"。</p>
<p class = "s2">The fon-family value of the text is "Tahoma"。</</p>
<p class = "s3">The fon-family value of the text is "Courer"。</</p>
<p class = "s4">The fon-family value of the text is "Verdana"。</</p>
<p class = "s5">The fon-family value of the text is "Book Antiqua"。</</p>
</body>
</html>
字体大小属性(font-size)
这个属性可以设置字体的大小。字体大小的设置可以有多种方式,最常用的就是pt和px(pixel)。例句如下:
.s2 {font-size:16pt}
看案例:
<html>
<head>
<title>字体大小属性 font-size</title>
<STYLE>
BODY{font-size:10pt}
.s1 {font-size:16px}
.s2 {font-size:16pt}
.s3 {font-size:80%}
.s4 {font-size:larger}
.s5 {font-size:xx-large}
</STYLE>
</head>
<body>
<p>这段文字大小是10pt。</p>
<p class = "s1">这段文字大小是16px。</p>
<p class = "s2">这段文字大小是16pt。</p>
<p class = "s3">这段文字大小是10pt的80%。</p>
<p class = "s4">这段文字的大小比10pt大。</p>
<p class = "s5">这段文字的大小是特大号(xx-large)。</p>
</body>
</html>
字体风格属性(font-style)
这个属性有三个值可选:normal, italic, oblique。normal是缺省值,italic, oblique都是斜体显示。例句如下:
.s1 {font-sytle:italic}
看案例:
<html>
<head>
<title>字体风格属性 font-style</title>
<STYLE>
.s1 {font-style:italic}
.s2 {font-style:oblique}
</STYLE>
</head>
<body>
<p>这段文字风格是normal,正常显示。normal是字体风格属性(font-style)的缺省值。</p>
<p class = "s1">这段文字的字体风格(font-style)属性值是italic,斜体显示。</p>
<p class = "s2">这段文字的字体风格(font-style)属性值是oblique,斜体显示。</p>
</body>
</html>
字体浓淡属性(font-weight)
这个属性常用值是normal和bold,normal是缺省值。例句如下:
<p style = "font-weight:bold">这段文字字体的浓淡属性(font-weight)值是bold。<p>
看案例:
<html>
<head>
<title>字体浓淡属性 font-weight</title>
</head>
<body>
<p>这段文字没有设浓淡属性。<p>
<p style = "font-weight:bold">这段文字字体的浓淡属性(font-weight)值是bold。<p

CSS字体属性 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数15
  • 收藏数0 收藏
  • 顶次数0
  • 上传人cjl201702
  • 文件大小184 KB
  • 时间2018-01-25
最近更新