<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
</head>
<style>
.cont {
display: flex;
width: 25%;
margin: 0 auto;
justify-content: space-around;
}
.left {
width: 200px;
height: 200px;
background-color: red;
margin-top: 50px;
}
.right {
width: 200px;
height: 200px;
background-color: green;
}
</style>
<body>
<div class="cont">
<!-- 左div -->
<div class="left"></div>
<!-- 右div -->
<div class="right"></div>
</div>
</body>
</html>
您好,您可以 参考这个代码哦。可以直接复制下来拿去使用(如果有用,望采纳)
温馨提示:答案为网友推荐,仅供参考