比较长的单词换行用属性hyphens:auto
兼容性:https://caniuse.com/#search=hyphens
两个注意要点:
1.html的lang="en-US"
2.需要设置css的word-break:break-all;
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>hyphens</title>
<style>
.div1 {
width: 100px;
height: 30px;
word-break: break-all;
hyphens: auto;
}
</style>
</head>
<body>
<div class="div1">fasdfasdfasdfsdfasfsdf</div>
</body>
</html>