<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
div {
height: 100px;
}
#left {
float: left;
width: 100px;
background-color: red;
}
#center {
background-color: orange;
margin: 0 100px;
}
#right {
float: right;
width: 100px;
background-color: blue;
}
</style>
</head>
<body>
<div id="left"></div>
<div id="right"></div>
<div id="center"></div>
</body>
</html>
思路:分別將前兩個div左浮動和右浮動,在將設置第三個div的margin即可