Home > Web Front-end > Front-end Q&A > What are the font styles in css

What are the font styles in css

王林
Release: 2023-05-29 14:06:38
Original
3075 people have browsed it

CSS is a language used for web page style expression, in which font style is also an important part of it. In CSS, font style can be controlled through the font attribute. The specific style is as follows:

  1. font-size: Set the font size, you can use relative units (such as em, %) or absolute units (such as px , pt).
  2. font-family: Set the font family, that is, set the font type that can be used to display text. You can set multiple font types. If the browser does not support the first font, it will try the second font. , and so on.
  3. font-weight: Set the font weight. You can set normal (normal font) and bold (bold font). You can also set relative thickness keywords (lighter, bolder) or numbers (100~900, where 100 is the thinnest and 900 is the thickest).
  4. font-style: Set the font style, you can set the value to normal (normal font), italic (italic font) or oblique (italic font).
  5. font-variant: Set the font variant. You can set the value to normal (normal font) or small-caps (small capital letters).
  6. font-stretch: Set the font stretching effect. The values ​​can be set to normal (normal font), condensed (compressed font), expanded (expanded font), extra-condensed (extremely compressed font), extra-expanded (extremely expanded font), semi-condensed (semi-compressed font), semi-expanded (semi-expanded font).
  7. line-height: Set the line height, which is also an important part when displaying text. The value can be set to a normal value or a specific pixel value or percentage.

In general, CSS provides a very rich font style. You can use these styles to finely control the display effect of text, making the web page more beautiful and easy to read.

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template