css字体怎么设置
时间:2022-02-11 16:38
css字体的设置方法:【font-family】规定元素的字体系列,【font-family】可以把多个字体名称作为一个【回退】系统来保存,如果浏览器不支持第一个字体,则会尝试下一个。 本教程操作环境:windows7系统、css3版,DELL G3电脑。 css字体的设置方法: 示例: 设置文本的字体: 效果图: 在 CSS 中,有两种不同类型的字体系列名称: 通用字体系列 - 拥有相似外观的字体系统组合(比如 "Serif" 或 "Monospace") 特定字体系列 - 具体的字体系列(比如 "Times" 或 "Courier") 除了各种特定的字体系列外,CSS 定义了 5 种通用字体系列: Serif 字体 Sans-serif 字体 Monospace 字体 Cursive 字体 Fantasy 字体 相关教程推荐:CSS视频教程 以上就是css字体怎么设置的详细内容,更多请关注gxlsystem.com其它相关文章!font-family
规定元素的字体系列。font-family
可以把多个字体名称作为一个“回退”系统来保存。如果浏览器不支持第一个字体,则会尝试下一个。<html>
<head>
<style type="text/css">
p.serif{font-family:"Times New Roman",Georgia,Serif}
p.sansserif{font-family:Arial,Verdana,Sans-serif}
</style>
</head>
<body>
<h1>CSS font-family</h1>
<p class="serif">This is a paragraph, shown in the Times New Roman font.</p>
<p class="sansserif">This is a paragraph, shown in the Arial font.</p>
</body>
</html>