A fast text wrap balancer for multi-line headlines on the web. https://www.ctrl.blog/entry/text-wrap-balance.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

40 lines
836 B

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Text Wrapping Boilerplate</title>
<style>
.balance-text {
visibility: hidden;
}
@media (scripting: none) {
.balance-text {
visibility: visible;
}
}
@supports (text-wrap: balance) {
.balance-text {
text-wrap: balance;
visibility: visible;
}
}
</style>
<noscript>
<style>
.balance-text {
visibility: visible !important;
}
</style>
</noscript>
</head>
<body>
<header style="max-width:40em">
<h1 class="balance-text">A Long Example Headline That Wraps Neatly Over Two Lines</h1>
</header>
<script>
// include text-balancer.js inline here
</script>
</body>
</html>