HTML & CSS · Senior · Question 39 of 75

What does text-wrap: balance do on a heading?

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.

Further reading

Problem with a question

HTML & CSS · Senior · question 39

Test yourself

Take the HTML & CSS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz