Home  >  Article  >  Web Front-end  >  What are the font attributes in css

What are the font attributes in css

王林
王林Original
2020-11-19 10:20:265552browse

The font attributes in css are: 1. Font style attribute font-family; 2. Font size attribute font-size; 3. Font style attribute font-style; 4. Font weight attribute font-weight; 5 , font deformation attribute font-vatiant.

What are the font attributes in css

css font attributes:

(Learning video sharing: css video tutorial)

font-family Set the font family.

h1 {font-family: Georgia;}

font-size Set the font size.

h1 {font-size:60px;}
h2 {font-size:40px;}
p {font-size:14px;}

font-style Set the font style.​

p.normal {font-style:normal;}
p.italic {font-style:italic;}
p.oblique {font-style:oblique;}

font-variant Display text in small caps font or normal font.

p {font-variant:small-caps;}

font-weight Set the thickness of the font.​

p.normal {font-weight:normal;}
p.thick {font-weight:bold;}
p.thicker {font-weight:900;}

Other properties include:

font-size-adjust When the preferred font is unavailable, intelligent scaling of the replacement font is performed. (CSS2.1 has removed this attribute.)

font-stretch Stretch the font horizontally. (CSS2.1 has deleted this attribute.)

Related recommendations: CSS tutorial

The above is the detailed content of What are the font attributes in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn