[CSS]CSS Styling - Styling Fonts
개발관련/CSS/CSS3 2012. 10. 23. 19:12 |출처: http://www.w3schools.com/css/css_font.asp
Difference Between Serif and Sans-serif Fonts
On computer screens, sans-serif fonts are considered easier to read than serif fonts.
CSS Font Families
In CSS, there are two types of font family names:
- generic family - a group of font families with a similar look (like "Serif" or "Monospace")
- font family - a specific font family (like "Times New Roman" or "Arial")
Generic family | Font family | Description |
---|---|---|
Serif | Times New Roman Georgia | Serif fonts have small lines at the ends on some characters |
Sans-serif | Arial Verdana | "Sans" means without - these fonts do not have the lines at the ends of characters |
Monospace | Courier New Lucida Console | All monospace characters have the same width |
Font Family
The font family of a text is set with the font-family property.
The font-family property should hold several font names as a "fallback" system. If the browser does not support the first font, it tries the next font.
Start with the font you want, and end with a generic family, to let the browser pick a similar font in the generic family, if no other fonts are available.
Note: If the name of a font family is more than one word, it must be in quotation marks, like font-family: "Times New Roman".
More than one font family is specified in a comma-separated list:
For more commonly used font combinations, look at our Web Safe Font Combinations.
All CSS Font Properties
Property | Description |
---|---|
font | Sets all the font properties in one declaration |
font-family | Specifies the font family for text |
font-size | Specifies the font size of text |
font-style | Specifies the font style for text |
font-variant | Specifies whether or not a text should be displayed in a small-caps font |
font-weight | Specifies the weight of a font |
CSS Fonts
Set the font of a text
Set the size of the font
Set the size of the font in px
Set the size of the font in em
Set the size of the font in percent and em
Set the style of the font
Set the variant of the font
Set the boldness of the font
All the font properties in one declaration
'개발관련 > CSS/CSS3' 카테고리의 다른 글
[CSS]CSS Styling - Styling Tables (0) | 2012.10.23 |
---|---|
[CSS]CSS Styling - Styling Lists (0) | 2012.10.23 |
[CSS]CSS Styling - Styling Links (0) | 2012.10.23 |
[CSS]CSS Styling - Styling Text (0) | 2012.10.23 |
[CSS]CSS Styling - Styling Backgrounds (0) | 2012.10.23 |