For consistent visual spacing with diverse web fonts, use unitless 'line-height' values (e.g., '1.5'). This scales proportionally with 'font-size', improving readability and maintaining UI balance across different font sizes and screen resolutions. Always test different web fonts as their inherent vertical metrics can vary significantly.
body {
font-family: 'Open Sans', sans-serif;
font-size: 16px;
line-height: 1.6; /* Unitless value for proportional scaling */
}
h1 {
font-family: 'Playfair Display', serif;
font-size: 2.8em;
line-height: 1.1; /* Tighter line-height for larger headlines */
margin-bottom: 0.5em;
}
p {
font-family: 'Open Sans', sans-serif;
line-height: 1.7; /* Slightly more generous for body text */
}
.callout {
font-family: 'Montserrat', sans-serif;
font-size: 1.1em;
line-height: 1.4; /* Adjusted for this font and size */
padding: 1em 1.5em;
background-color: #f0f8ff;
border-left: 4px solid #007bff;
}