代码:
<!DOCTYPE html>
<html>
<head>
<style>
* {
box-sizing: border-box;
}
.container {
display: flex;
justify-content: space-between;
width: 800px;
margin: 0 auto;
border-top: 1px solid black;
overflow: hidden;
}
.left,
.middle,
.right {
float: left;
width: 32%;
height: 300px;
}
.left {
background-color: red;
}
.middle {
background-color: blue;
}
.right {
background-color: green;
}
</style>
</head>
<body>
<div class="container">
<div class="left"></div>
<div class="middle"></div>
<div class="right"></div>
</div>
</body>
</html>
效果图: