CSS现代字体栈
CSS字體棧是一系列的字體,它包含了能在不同操作系統和平臺上戰士的字體,以盡可能的使排版保持一致性。瀏覽器會在font-family規定的所有字體中從前往后一次查找,如果找不到當前字體就查找下一個字體。
創建字體棧的原則是使用多個操作系統或者終端所共有的或者交叉范圍大的一系列字體,需要大量備用字體。
1 /* 基于Times New Roman的字體風格*/ 2 font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; 3 4 /* 基于現代Georgia的字體風格*/ 5 font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif; 6 7 /*基于Garamond的更傳統的字體風格*/ 8 font-family: "Palatino Linotype", Palatino, Palladio, "URW Palladio L", "Book Antiqua", Baskerville, "Bookman Old Style", "Bitstream Charter", "Nimbus Roman No9 L", Garamond, "Apple Garamond", "ITC Garamond Narrow", "New Century Schoolbook", "Century Schoolbook", "Century Schoolbook L", Georgia, serif; 9 10 /*基于Helvetica/Arial的字體風格*/ 11 font-family: Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif; 12 13 /*基于Verdana的字體風格*/ 14 font-family: Corbel, "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", "Bitstream Vera Sans", "Liberation Sans", Verdana, "Verdana Ref", sans-serif; 15 16 /*基于Trebuchet的字體風格*/ 17 font-family: "Segoe UI", Candara, "Bitstream Vera Sans", "DejaVu Sans", "Bitstream Vera Sans", "Trebuchet MS", Verdana, "Verdana Ref", sans-serif; 18 19 /*更有深度的"Impact" 的字體風格*/ 20 font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", Charcoal, "Helvetica Inserat", "Bitstream Vera Sans Bold", "Arial Black", sans-serif; 21 22 /*monospace 的字體風格*/ 23 font-family: Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace;?
總結
- 上一篇: 2021-08-13
- 下一篇: CSS 基本样式