BFC佈局詳解,模塊垂直居中詳解:https://www.cnblogs.com/hz1124/p/6131795.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example </title>
</head>
<body>
<div class="box">
<p class="charset">
assafadsassssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
</p>
</div>
</body>
</html>
<style>
body,html{
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center
}
.box{
height: 300px;
width: 300px;
background-color: bisque;
display: flex;
position: relative;
}
.charset{
width: 100%;
word-wrap: break-word;
word-break: break-all;
}
</style>