Python devweb之css实例一
three.css
.container {
width: 800px;
margin: 0 auto;
}
.header{
height: 100px;
background: gray;
}
.left{
width: 200px;
height: 300px;
background: chartreuse;
float: left;
}
.middle{
height: 300px;
background: purple;
}
.right{
float: right;
width: 200px;
height: 300px;
background: brown;
}
.footer{
width: 800px;
margin: 0 auto;
text-align: center;
background: gray;
}
three.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="three.css">
</head>
<body>
<div class="container">
<div class="header"></div>
<div class="content">
<!--注意left--> right--> middle 顺序-->
<div class="left">left</div>
<div class="right">right</div>
<div class="middle">middle</div>
</div>
<div class="footer">
<a href="http://linux.tedu.cn">Hello world!!</a>
</div>
</div>
</body>
</html>
执行three.html的结果