Sample:
p {
font-family: Georgia, Times, "Times New Roman", serif;
}
font-family 用于设置字体
浏览器会根据提供的信息寻找合适的字体;如果第一个字体失败就找第二个字体
比如这里的Sample就是这样的顺序寻找的:Georgia >Times > "Times New Roman" > serif;
由于Times New Roman是多单词的字体名称,这里需要用引号包围起来
其他的字体也可以用引号包围,不过为了不让浏览器出现不必要执行问题,
还是不建议Quote上引号
另外这里的serif并不是一种的字体,而是由多个字体组成的Generic Font Family Value
还有更多的GFGvalue,看下表
serif:Georgia, Times, Times New Roman, Garamond, and Century Schoolbook
sans-serif:Verdana, Arial, Helvetica, Trebuchet, and Tahoma
monospace:Courier, MS Courier New, and Prestige
cursive:Lucida Handwriting and Zapf-Chancery
fantasy:Comic Sans, Whimsey, Critter, and Cottonwood