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

What Does the Slash Mean in CSS Font Sizing?

Mary-Kate Olsen
Release: 2024-11-10 01:51:02
Original
316 people have browsed it

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!

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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template