Web前端技术:案例:div浮动
效果图:
完整代码:
<!DOCTYPE html>
<bead>
<meta charset="utf-8">
<title>div</title>
<style type="text/css">
#big-content{
text-align:center;
margin:30px 120px;
}
#header{
background-color:blue;
width:;
height:30px;
float:;
}
#content-left{
background-color:yellow;
width:50%;
height:;
float:left;
}
#content-right{
background-color:green;
width:50%;
height:;
float:left;
}
#footer{
background-color:pink;
width:;
height:;
float:;
}
</style>
</bead>
<div id="big-content">
<div id="header"><p>这是header部分</p>
</div>
<div id:"main">
<div id="content-left"><p>这是content-left部分</p>
</div>
<div id="content-right"><p>这是content-right部分</p>
</div>
</div>
<div id="footer"><p>这是footer部分</p>
</div>
</div>
<body>
</body>