HTML & CSS · Senior · Question 39 of 75
What does text-wrap: balance do on a heading?
- 1Justifies the text by stretching the spaces
- ✓Correct answer: Distributes words so the lines are roughly equal in length
- 3Prevents wrapping and truncates the text with an ellipsis
Explanation
balance chooses line breaks so a multi-line heading's lines are close in length - no orphaned last word. The algorithm is expensive, so browsers apply it only to short blocks (a few lines). For paragraphs there's text-wrap: pretty, which avoids a single word on the last line. Justification is text-align: justify.