<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.main{
width: 50%;
border: 1px solid black;
}
.main::after{
display: block;
content: "";
clear: both;
}
.middle{
width: 100%;
/* background-color: royalblue; */
height: 500px;
float: left;
}
.middle div{
margin-left: 100px;
margin-right: 100px;
background-color: royalblue;
height: 500px;
}
.left{
width: 100px;
height: 100px;
background-color: red;
float: left;
margin-left: -100%;
/* position: relative;
left: -100px;
top: 0; */
}
.right{
width: 100px;
height: 300px;
background-color: red;
float: left;
margin-left: -100px;
/* position: relative;
left: 100px;
top: 0; */
}
</style>
</head>
<body>
<div class="main">
<div class="middle">
<div></div>
</div>
<div class="left"></div>
<div class="right"></div>
</div>
</body>
</html>