我想實現一個簡單的佈局,緊緊這樣表示:基本HTML佈局
_________________________
| | header | |
| L |_____________| R |
| | | |
| | | |
| | | |
| | main | |
| | | |
| | | |
| | | |
|_____|_____________|_____|
我開發這個代碼來完成我的目標:
<!DOCTYPE html>
<html>
<head>
<title>Layout</title>
<style>
* {
margin: 0px;
padding: 0px;
}
p {
text-align: center;
}
div#left {
float: left;
background-color: #777;
width: 200px;
height: 650px;
}
div#header {
float: left;
background-color: #eee;
width: 940px;
height: 60px;
}
div#main {
float: left;
width: 940px;
}
div#right {
float: right;
background-color: #777;
width: 200px;
height: 650px;
}
</style>
</head>
<body>
<div id="left">
<p>Left</p>
</div>
<div id="header">
<p>Header</p>
</div>
<div id="main">
<p>Main</p>
</div>
<div id="right">
<p>Right</p>
</div>
</body>
但我可以」讓'右'欄保持與頂部對齊。有人可以指定我在CSS中更改什麼來糾正此問題嗎? 謝謝!
現在好了!謝謝! – tessiof