首页 > 代码库 > 右侧定宽左侧自适应布局

右侧定宽左侧自适应布局

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}

.left {
margin-right: 200px;
height: 200px;
background-color: red;
}

.right {
float: right;
width: 200px;
height: 200px;
background-color: green;
}
</style>
</head>

<body>
<div class="right"></div>
<div class="left"></div>
</body>

</html>

右侧定宽左侧自适应布局