<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.w {
width: 200px;
}
.l {
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: calc(100% - 52px);
vertical-align: middle;
}
.r {
vertical-align: middle;
}
.w2 {
display: flex;
width: 200px;
}
.l2 {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.r2 {
flex: 1;
white-space: nowrap;
}
</style>
</head>
<body>
<div class="w">
<div class="l">设置地图级别,级别为数字</div>
<span class="r">状态</span>
</div>
<div class="w2">
<div class="l2">设置地图级别,级别为数字</div>
<div class="r2">状态</div>
</div>
</body>
</html>
原文地址:https://www.cnblogs.com/Cinderellablog/p/10408613.html