Imagine What You’ll Build Tomorrow Get Started free Mozilla ads

Don't want to see ads?

# Playground

HTML
99
1
2
3
4
5
6
7
8
9
10
11
12
<h2 class="wrap" contenteditable="true">
The default behavior; the text in the heading wraps "normally"
</h2>
<h2 class="nowrap" contenteditable="true">
In this case the text in the heading doesn't wrap, and overflows the container
</h2>
<h2 class="balance" contenteditable="true">
In this case the text in the heading is nicely balanced across lines
</h2>
CSS
Selection deleted
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
.nowrap {
text-wrap: balance;
}
.balance {
text-wrap: balance;
}
h2 {
font-size: 2 rem;
font-family: sans-serif;
}
JAVASCRIPT
9
1
Console

Discover How Secure Your Database Really Is How secure and compliant are your databases? Ease your worries with a database security assessment.Get a quote.
Ad
Don't want to see ads?