What Does the Slash Mean in CSS Font Sizing?
Nov 10, 2024 am 01:51 AMUnderstanding 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!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Create a JavaScript Contact Form With the Smart Forms Framework

Adding Box Shadows to WordPress Blocks and Elements

Making Your First Custom Svelte Transition

Demystifying Screen Readers: Accessible Forms & Best Practices

Comparing the 5 Best PHP Form Builders (And 3 Free Scripts)
