在开发中页面布局经常用到的两栏布局。
html:
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="1.css">
<style type="text/css">
</style>
</head>
<body>
<div class="right"></div>//细节问题,一定将right布局放在left前面
<div class="left"></div>
</body
</html>
css:
*{
padding: 0;
margin: 0;
}
.left{
background-color: #f40;
margin-right: 100px;
height: 100px;
}
.right{
width: 100px;
height: 100px;
background-color: #ccc;
position: absolute;
right: 0;
}