<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>并排贴靠</title>
<style>
.box div {
float: left;
}
.box {
width: 510px;
height: 400px;
border: 1px solid green;
}
.box1 {
width: 100px;
height: 300px;
background-color: red;
}
.box2 {
width: 150px;
height: 100px;
background-color: pink;
}
.box3 {
width: 200px;
height: 200px;
background-color: blue;
}
</style>
</head>
<body>
<div class="box">
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
</div>
</body>
</html>
上述运行结果: