Home  >  Article  >  Web Front-end  >  What Does the Slash Mean in CSS Font Sizing?

What Does the Slash Mean in CSS Font Sizing?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-10 01:51:02292browse

What Does the Slash Mean in CSS Font Sizing?

Understanding the Purpose of the Slash in CSS Font Sizing

The slash character in CSS font sizing, as seen in the example "font: 100%/120%;", holds a specific significance. It separates two values that set different font-related properties.

Equivalent Properties

Using the slash in this context is equivalent to setting two individual properties:

  • font-size: 100%;
  • line-height: 120%;

Typographical Tradition

This syntax mimics the traditional typographic notation used to denote glyph size and line height as "x pt on y pt".

Incorrect Usage

However, it's important to note that the example provided in the question, "font: 100%/120%;", is invalid. In the shorthand notation, at least both the font size and family must be specified. To make it valid, one could add a generic font family name, such as:

"font: 100%/120% serif;"

The above is the detailed content of What Does the Slash Mean in CSS Font Sizing?. 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