overflow:hidden;white-space:normal;word-break:break-all;text-overflow:ellipsis
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="site.webmanifest">
<link rel="apple-touch-icon" href="icon.png">
<!-- Place favicon.ico in the root directory -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<meta name="theme-color" content="#fafafa">
<style>
@media screen and (max-width: 700px){
.demo{
border: 1px solid #000000;
width: 50px;
height: 20px;
overflow:hidden;
text-overflow:ellipsis;
word-break:break-all;
white-space:nowrap;
margin: 0 auto;
}
body{
background-color: red;
}
}
@media screen and (max-width: 500px){
.demo{
border: 1px solid #000000;
width: 50px;
height: 20px;
overflow:hidden;
word-break:break-all;
text-overflow:ellipsis;
white-space:nowrap;
margin: 0 auto;
}
body{
background-color: blueviolet;
}
}
</style>
</head>
<body>
<!--[if IE]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
<![endif]-->
<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<div class="demo">啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦</div>
</body>
</html>