<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>左右浮动</title>
<style>
.box1 {
width: 200px;
height: 200px;
background-color: red;
/*display: inline-block;*/
/*margin-right: 100px;*/
float: left;
/*min-*/
/*max-*/
}
.box2 {
width: 300px;
height: 300px;
background-color: pink;
display: inline-block;
float: right;
}
</style>
</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
</body>
</html>
上述运行结果: