<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
div{
padding:10px;
border:1px solid #000;
font-size:17px;
width:180px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<h1>CSS word-break Property</h1>
<div>
This text will break to next line 这是绕道而行的好方法 WhenWordBreakBreakAllIsUsed.
</div>
<button onclick="myFunction()">Click Me</button>
<script>
var x = document.getElementsByTagName("div")[0];
function myFunction(){
x.style.wordBreak = "keep-all";
}
</script>
<p><strong>Note</strong>: Click on the button to change the 'word-break' from normal to keep-all.</p> </body>
</html>