Css 简明教程
CSS - Font
CSS 字体允许使用各种与字体相关的属性来自定义网页的字体样式。在本教程中,我们将了解 CSS 中的字体样式。
CSS Fonts allows to customize font style of webpages using various font related properties. In this tutorial we will understand the font styling in CSS.
What is CSS Font?
在 CSS 中,font 属性用于设置和调整网页中使用的文本类型。
In CSS font property is used to style and adjust type of text used in webpage.
你可以通过设置 * font-family, font-size, font-weight* 和 * font-style.* 属性来定义字体并自定它们的显示样式。你还可以使用 * font* 速记属性来操作所有字体样式。
You can define fonts and customize their appearance by setting properties like font-family, font-size, font-weight and font-style. You can also use shorthand property font to manipulate all the font style.
Types of Font Families
-
Monospace Fonts: The font in which every letter have equal width.
-
Serif Fonts: Have small stroke at the edge of each letter.
-
San-Serif Fonts: Clean fonts with out any strokes.
-
Fantasy Fonts: Decorative fancy fonts.
-
Cursive Fonts: The font that resembles human handwriting.
Popular CSS Fonts
Generic Font Family |
Examples of Font Names |
Serif |
Times New RomanGeorgiaGaramond |
Sans-serif |
ArialVerdanaHelvetica |
Monospace |
Courier NewLucida ConsoleMonaco |
Cursive |
Brush Script MTLucida Handwriting |
Fantasy |
CopperplatePapyrus |
Property |
Description |
Example |
Specifies the font for an element. |
||
Specifies the size of the font. |
||
Specifies the boldness of the font. |
||
Specifies the style of the font (normal, italic, oblique). |
||
Specifies whether or not a text should be displayed in a small-caps font. |
||
Specifies the line height. |