Languages
[Edit]
EN

CSS - set text line height

0 points
Created by:
Violetd
925

In this article, we would like to show you how to

Quick solution:

Note:

The line-height property can be set to:

  • keyword value (e.g. line-height: normal),
  • unitless value (e.g. line-height: 2.5),
  • length value (e.g. line-height: 3em),
  • percentage value (e.g. line-height: 35%),
  • global value (e.g. line-height: inherit).

 

Practical example

Edit

In this section, we present some div elements with example line-height values.

Note:

line-height: 1.2 in most cases is the default value, equivalent to line-height: normal. However, this depends on the user agent and element's font-family.

 

References

Edit
  1. line-height - CSS: Cascading Style Sheets | MDN

Alternative titles

  1. CSS - how to set text line height property
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join