(练习)淘宝页面的基本框架
根据浮动,定位知识,做一个小练习,制作一个简易的淘宝页面框架.
其代码如下
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
.tb1{
width: 250px;
background-color: #6495ED;
height: 500px;
float: right;
}
.tb2{
width: 250px;
background-color: #6495ED;
height: 500px;
float:left;
}
#b2{
width: 1248px;
height:300px;
}
.tb3{
width: 500px;
height: 300px;
background-color: #FF7F50;
position: relative;
left: 260px;
bottom: 500px;
margin: 0;
}
.tb4{
width: 200px;
height: 300px;
background-color: aquamarine;
position: relative;
left: 780px;
bottom: 800px;
margin: 0;
}
.tb5{
width: 230px;
height: 180px;
background-color: cadetblue;
position: relative;
left: 260px;
bottom: 780px;
}
.tb6{
width: 230px;
height: 180px;
background-color: #8A2BE2;
position: relative;
left: 500px;
bottom: 960px;
}
.tb7{
width: 230px;
height: 180px;
background-color: #8A2BE2;
position: relative;
left: 740px;
bottom: 1140px;
}
</style>
</head>
<body>
<div id="b2">
<div class="tb1">右</div>
<div class="tb2">左</div>
<div style="clear:both;"></div>
<div class="tb3">中间左上</div>
<div class="tb4">中间右上</div>
<div class="tb5">中间左下</div>
<div class="tb6">中间下方</div>
<div class="tb7">中间右下</div>
</div>
</div>
</body>
</html>
运行结果