section標籤定義文件中的節(section、區段)。比如章節、頁首、頁尾或文件中的其他部分。 HTML 4.01 與 HTML
5 之間的差異
section標籤是 HTML 5 中的新標籤。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>北國風光</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css" media="screen, projection">
body {
line-height:1;
color:#333;
}
ol, ul, h1 {
margin:0;
padding:0;
list-style:none;
a {
color: #933;
text-decoration: none;
a:hover {
color: #DF3030;
nav h1 {
text-align:center;
nav h1 img {
width:90%;
nav ul {
border-top: 1px solid #999;
nav li {
text-align: center;
border-bottom:1px solid #ccc;
line-height:60px;
nav li a {
display:block;
nav li a:hover {
background-color:#e4e4e4;
section {
font-size:14px;
font-family:"宋體";
section h2 {
font-size:18px;
font-family:"黑體";
font-weight:lighter;
section span {
padding:0 10px;
background-color:#FFF;
section li {
section li img {
width:98%;
border-radius:5px;
section article {
margin-top:20px;
padding-bottom:20px;
.clear {
clear:both;
line-height:5px;
footer {
clear:both;border-top: 1px solid #999;
font-size: 12px;
padding: 10px 0;
font-family:Arial, Helvetica, sans-serif;
color:#666;
@media (max-width: 400px) {
float:left;
width:32%;
margin-left:1%;
padding:20px 0;
margin:10px 2px;
section li span {
font-size:12px;
@media (min-width:400px) and (max-width: 600px) {
width:48%;
@media (min-width:600px) and (max-width:900px) {
nav {
width:35%;
width: 65%;
@media (min-width: 900px) {
height:200px;
</style>
</head>
<body>
<nav>
<ul>
</ul>
</nav>
<section>
<article>
<h2><span>風光圖片集</span></h2>
<ol>
</ol>
<div></div>
</article>
<footer> 北國風光© 2011</footer>
</section>
</body>
</html>
section標籤定義文件中的節(section、區段)。比如章節、頁首、頁尾或文件中的其他部分。 HTML 4.01 與 HTML
5 之間的差異
section標籤是 HTML 5 中的新標籤。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>北國風光</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css" media="screen, projection">
body {
line-height:1;
color:#333;
}
ol, ul, h1 {
margin:0;
padding:0;
list-style:none;
}
a {
color: #933;
text-decoration: none;
}
a:hover {
color: #DF3030;
}
nav h1 {
text-align:center;
}
nav h1 img {
width:90%;
}
nav ul {
border-top: 1px solid #999;
}
nav li {
text-align: center;
border-bottom:1px solid #ccc;
line-height:60px;
}
nav li a {
display:block;
}
nav li a:hover {
background-color:#e4e4e4;
}
section {
font-size:14px;
font-family:"宋體";
}
section h2 {
font-size:18px;
text-align:center;
font-family:"黑體";
font-weight:lighter;
}
section span {
padding:0 10px;
background-color:#FFF;
}
section li {
text-align:center;
}
section li img {
width:98%;
border-radius:5px;
}
section article {
border-top: 1px solid #999;
margin-top:20px;
padding-bottom:20px;
}
.clear {
clear:both;
line-height:5px;
}
footer {
clear:both;border-top: 1px solid #999;
font-size: 12px;
text-align: center;
padding: 10px 0;
font-family:Arial, Helvetica, sans-serif;
color:#666;
}
@media (max-width: 400px) {
nav li {
float:left;
width:32%;
margin-left:1%;
}
section {
clear:both;
padding:20px 0;
}
section li {
margin:10px 2px;
}
section li span {
display:block;
text-align:center;
font-size:12px;
}
}
@media (min-width:400px) and (max-width: 600px) {
nav li {
float:left;
width:32%;
margin-left:1%;
}
section {
clear:both;
padding:20px 0;
}
section li {
float:left;
margin:10px 2px;
width:48%;
}
section li span {
display:block;
text-align:center;
font-size:12px;
}
}
@media (min-width:600px) and (max-width:900px) {
nav {
float:left;
width:35%;
}
section {
float:left;
width: 65%;
padding:20px 0;
}
section li {
float:left;
margin:10px 2px;
width:48%;
}
section li span {
display:block;
text-align:center;
font-size:12px;
}
}
@media (min-width: 900px) {
nav h1 {
float:left;
width:35%;
height:200px;
}
nav ul {
float:left;
width: 65%;
}
nav li {
float:left;
width:32%;
margin-left:1%;
}
section {
float:left;
width: 65%;
padding:20px 0;
}
section li {
float:left;
margin:10px 2px;
width:32%;
}
section li span {
display:block;
text-align:center;
font-size:12px;
}
}
</style>
</head>
<body>
<nav>
<ul>
</ul>
</nav>
<section>
<article>
<h2><span>風光圖片集</span></h2>
<ol>
</ol>
<div></div>
</article>
<footer> 北國風光© 2011</footer>
</section>
</body>
</html>