HTML: Change line spacing via CSS - how it works
Related Videos: Adjusting Line Height for Text in WordPress - CSS (May 2024).
In an HTML document, you can change the line spacing using "style". This practical tip shows you how to solve this with the help of CSS.
HTML: Change line spacing via CSS with "line-height" - how it works
To change the line spacing via CSS, you should use the "line-height" command. It is possible to specify the line spacing as a percentage of the font size or as an absolute value:
- With a percentage like "line-height: 120%" the line spacing is increased by 1.2 times the standard spacing.
- With a floating point number, for example "line-height: 1.2", you also increase the line spacing by 1.2 times.
- You can also use absolute values like "line-height: 30px" to fix the line spacing.
In our next article we will show you how to insert images correctly with CSS.