頁面組成
一般網頁的畫面由三大區塊組成,分別為 header、container、footer,依版面需求再做切割。這不是絕對,不同的開發者有不同的手法。
舉例
html:
一般網頁的畫面由三大區塊組成,分別為 header、container、footer,依版面需求再做切割。這不是絕對,不同的開發者有不同的手法。
舉例
html:
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<meta http-equiv=”X-UA-Compatible” content=”ie=edge”>
<title>Document</title>
</head>
<body>
<div id = “wrapper”>我是 container
<div id = “header”>我是 header</div>
<div id = “container”>我是 container</div>
<div id = “footer”>我是 footer</div>
</div>
</body>
<
ml>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<meta http-equiv=”X-UA-Compatible” content=”ie=edge”>
<title>Document</title>
</head>
<body>
<div id = “wrapper”>我是 container
<div id = “header”>我是 header</div>
<div id = “container”>我是 container</div>
<div id = “footer”>我是 footer</div>
</div>
</body>
<

css:
body {
background-color: orange;
}
background-color: orange;
}
#wrapper {
background-color: blue;
width: 1000px;
margin: 0 auto;
padding: 20px 0;
}
#header {
background-color: red;
width: 900px;
height: 100px;
margin: 0 auto;
}
#container {
background-color: pink;
width: 900px;
height: 100px;
margin: 0 auto;
}
#footer {
background-color: green;
width: 900px;
height: 100px;
margin: 0 auto;
}
转载请注明:XAMPP中文组官网 » 網頁基本架構