The best CSS line-height property Tutorial In 2024, In this tutorial you can learn Examples,Attribute definitions and instructions,Browser Support,Property Value,More examples,related articles,
Set the line height in percent:
Setting line height in percent:
Note: negative values are not allowed
Defaults: | normal |
---|---|
inherit: | yes |
version: | CSS1 |
JavaScript syntax: | object .style.lineHeight = "2" |
Figures in the table represent the first browser to support the version number of the property.
属性 | |||||
---|---|---|---|---|---|
line-height | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
value | description |
---|---|
normal | default. Set a reasonable line spacing. |
number | Set the number, this number will be multiplied with the current font size to set the line spacing. |
length | Set a fixed line spacing. |
% | Spacing based on the current font size of the percentage of rows. |
inherit | Provisions should inherit the property line-height value from the parent element. |
Using the pixel value is set line spacing
This example demonstrates how to use the pixel values to set the paragraph line spacing.
Use to set the line spacing value
This example demonstrates how to use a value to set the paragraph line spacing.
CSS tutorial: CSS the Text