The line-break property for CSS specifies the strictness of line-breaking rules applied within an element: especially how wrapping interacts with punctuation and symbols.
object.style.lineBreak = "value"; <'line-break'> = auto | loose | normal | strict | anywhere auto Automatically specified by the user agent.
loose Breaks text using the least restrictive set of line-breaking rules.
normal Breaks text using the most common set of line-breaking rules.
strict Breaks text using the most stringent set of line-breaking rules.
anywhere There is a soft wrap opportunity around every typographic character unit, including around any punctuation character or preserved white spaces, or in the middle of words, disregarding any prohibition against line breaks, even those introduced by characters with the GL, WJ, or ZWJ character class or mandated by the word-break property. The different wrapping opportunities must not be prioritized. Hyphenation is not applied.
<!doctype html>
<html>
<head>
<style>
p
{
line-break: auto;
}
</style>
</head>
<body>
<p>auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto auto</p>
</body>
</html>
<!doctype html>
<html>
<head>
<style>
p
{
line-break: loose;
}
</style>
</head>
<body>
<p>loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose loose</p>
</body>
</html>
<!doctype html>
<html>
<head>
<style>
p
{
line-break: normal;
}
</style>
</head>
<body>
<p>normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal normal</p>
</body>
</html>
<!doctype html>
<html>
<head>
<style>
p
{
line-break: strict;
}
</style>
</head>
<body>
<p>strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict strict</p>
</body>
</html>
<!doctype html>
<html>
<body>
<button>initial</button>
<button>anywhere</button>
<button>auto</button>
<button>loose</button>
<button>normal</button>
<button>strict</button>
<p>line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break line-break</p>
<script>
function myfunction(myparameter)
{
document.querySelector("p").style.lineBreak = myparameter.target.innerHTML;
}
for(const mybutton of document.querySelectorAll("button"))
{
mybutton.addEventListener("mouseover", myfunction);
}
</script>
</body>
</html>