<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
<style>
#container {
width: 1000px;
margin:0px auto;
background: gray;
}
#header {
height: 150px;
background: red;
}
#main {
height: 500px;
background: gray;
}
#footer {
height: 100px;
background: black;
clear: both;
}
#left {
float: left;
width: 750px;
height: 500px;
background: green;
}
#right {
float: right;
width: 250px;
height: 500px;
background: blue;
}
.four {
float: left;
width: 350px;
height: 230px;
margin: 10px;
background: yellow;
}
</style>
</head>
<body>
<div id="container">
<div id="header"></div>
<div id="main">
<div id="left">
<div class="four"></div>
<div class="four"></div>
<div class="four"></div>
<div class="four"></div>
</div>
<div id="right"></div>
</div>
<div id="footer"></div>
</div>
</body>
</html>
HTML&CSS学习2——布局
最新推荐文章于 2024-02-29 20:35:30 发布