Which CSS property is used to control the spacing between lines of text?

Prepare for the CodeHS Advanced HTML and CSS Test. Study comprehensive modules with multiple-choice questions, flashcards, tips, and explanations. Master advanced topics in HTML and CSS to excel in your exam!

The line-height property is essential for controlling the vertical spacing between lines of text in a block of text. By defining this property, you can specify how much space should exist between the baselines of adjacent lines, which helps improve readability and overall visual appearance. A larger value for line-height increases the space between lines, while a smaller value decreases it. It can accept unit values like pixels, ems, or simply numeric values which are multiplied by the font size to determine the line height.

The other properties serve different purposes: letter-spacing adjusts the space between individual letters, spacing is not a valid CSS property for spacing text, and text-indent defines the indentation of the first line in a paragraph rather than line spacing. Each of these has its specific function, while line-height directly addresses the need for managing line spacing effectively.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy