CSS font Properties Define the font family, size, bold, style (such as italic), and distortion (such as small capital letters) of text.
Reference: http://www.w3school.com.cn/css/css_font.asp
5 Universal Font Families:
①serif fonts
②sans-serif fonts
③monospace fonts
④cursive fonts
⑤fantasy fonts
- Specify Word System Class
{font-family: Times , Timesnr, ' New Century schoolbook ', Georgia, ' new York ', serif;}
Often used to specify italic text. A total of three values: Normal,italic and oblique.
{Font-style:normal;} {font-style:italic;} {font-style:oblique;}
Small caps can be set.
{font-variant: normal} {font-variant: small-caps}
Use:
<class= "normal">This is a test</p> <class= "small">This is a test</p >
Effect:
Sets the thickness of the text. A 9-level thickness was specified for the font from 100~900. 400 corresponds to normal, while 700 corresponds to bold.
{font-weight:normal;} {font-weight:bold;} {font-weight:;}
Use:
<Pclass= "normal">This is a test</P><Pclass= "thick">This is a test</P><Pclass= "Thicker">This is a test</P>
Effect:
Sets the font size of the text. The default normal default size is 16 pixels (16px = 1em). It is likely that you will use EM to set the font size in IE.
{font-size:60px;} {font-size:2.5em;} {font-size:0.875em;}
CSS Font Properties
Properties |
Description |
Font |
Shorthand property. The function is to set all the font-oriented properties in a single declaration. |
Font-family |
Sets the font family. |
Font-size |
Sets the size of the font. |
Font-size-adjust |
Intelligently scales the replacement font when the preferred font is not available. (CSS2.1 has deleted this property.) ) |
Font-stretch |
Horizontally stretches the font. (CSS2.1 has deleted this property.) ) |
Font-style |
Sets the font style. |
Font-variant |
Displays text in a small uppercase font or in a normal font. |
Font-weight |
Sets the weight of the font. |
CSS Notes (v) fonts