1.字体分类
SERIF:衬线字体。在字母的主要笔画末端有额外装饰。适合长篇文本
SANS_SERIF无衬线字体。文本小的时候运用
MONOSPACE等宽字体。每个字母宽度相同。用于显示代码
CURSIVE:草书字体
FANTASY虚幻字体,用于标题。不适合长篇文本
2.字体选用font-family
<style type="text/css">body {font-family: Georgia, Times, serif;}h1, h2 {font-family: Arial, Verdana, sans-serif;}.credits {font-family: "Courier New", Courier, monospace;}</style>
3.字体大小font-size<style type="text/css">body {font-family: Arial, Verdana, sans-serif;font-size: 12px;}h1 {font-size: 200%;}h2 {font-size: 1.3em;}</style>像素,百分数,em。
4.用font-face下载字体
<style type="text/css">@font-face {font-family: 'ChunkFiveRegular';src: url('fonts/chunkfive.eot');}h1, h2 {font-family: ChunkFiveRegular, Georgia, serif;}</style>
5.粗体
<style type="text/css">.credits {font-weight: bold;}</style>normal普通粗细。bold粗体
6.斜体
<style type="text/css">.credits {font-style: italic;}</style>
oblique或italic
7.大小写
h1 {text-transform: uppercase;}h2 {text-transform: lowercase;}.credits {text-transform: capitalize;}
uppercase大写,lowercase小写,capitalize首字母大写8.下划线或删除线
.credits {text-decoration: underline;}a {text-decoration: none;}
none,无装饰线
underline文本下方添加实线
overline文本上方添加实线
line-through穿过文本
blink文本闪烁