Home > Article > Web Front-end > 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:
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!