<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>中间固定,两侧自适应</title>
<style>
* {
margin: 0;
padding: 0;
}
.div {
display: flex;
width: 100%;
height: 100px;
}
.center {
width: 200px;
height: 100px;
background-color: blue;
}
.left,
.right {
flex: 1;
height: 100px;
background-color: red;
}
</style>
</head>
<body>
<div class="div">
<div class="left"></div>
<div class="center"></div>
<div class="right"></div>
</div>
</body>
</html>