HTML and CSS Certification Practice Test

Question: 1 / 400

What CSS property is used to change the spacing between lines of text?

line-spacing

padding

line-height

The CSS property used to change the spacing between lines of text is line-height. This property controls the vertical space between different lines within a block of text, allowing you to create more white space between lines or to make the text more compact. By adjusting the line-height value, which can be set using units like pixels, ems, or as a unitless number, you can significantly influence the readability and aesthetics of text on the web.

While padding and margin are also properties related to spacing, they pertain to the space around elements. Padding affects the space between the content of an element and its border, while margin is the space outside an element's border. These properties do not influence the vertical spacing between individual lines of text within an element. Additionally, line-spacing is not a valid CSS property; rather, the correct terminology is line-height. This highlights the specificity and importance of using the proper CSS property to achieve the desired effect for line spacing in text.

Get further explanation with Examzify DeepDiveBeta

margin

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy