<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style>
* {
margin: 0;
padding: 0;
}
.block {
width: 100%;
margin: 0 auto;
}
.left {
width: 200px;
height: 300px;
float: left;
border: 1px solid black;
}
.center {
position: absolute;
left: 200px;
right: 200px;
background-color: yellow;
height: 300px;
}
.right {
width: 200px;
height: 300px;
float: right;
border: 1px solid black;
}
</style>
<body>
<div class="block">
<div class="left">左边</div>
<div class="center">中间</div>
<div class="right">右边</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style>
* {
margin: 0;
padding: 0;
}
.block {
width: 100%;
margin: 0 auto;
}
.left {
width: 200px;
height: 300px;
float: left;
border: 1px solid black;
}
.center {
margin-left: 200px;
margin-right: 200px;
border: 1px solid black;
}
.right {
width: 200px;
height: 300px;
float: right;
border: 1px solid black;
}
</style>
<body>
<div class="block">
<div class="left">左边</div>
<div class="center">中间</div>
<div class="right">右边</div>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style>
.block {
display: flex;
flex-flow: row nowrap;
}
.right,.left {
width: 200px;
height: 200px;
border: 1px solid black;
}
.center {
flex-grow: 1;
border : 1px solid red;
}
</style>
<body>
<div class="block">
<div class="right">右边</div>
<div class="center">中间</div>
<div class="left">左边</div>
</div>
</body>
</html>