標籤:html5
HTML5學習:語義元素section
一、定義
<section> 標籤定義文檔中的節(section、區段)。比如章節、頁首、頁尾或文檔中的其他部分。
二、用法
section標籤下一般有一個標題<h1></h1>、還有一個內容<p></p>。範例程式碼如下:
<!DOCTYPE html><html> <head> <meta name="content-type" content="text/html; charset=UTF-8"> </head> <body> <section> <h1>標題1</h1> <p>內容1</p> </section> <section> <h1>標題2</h1> <p>內容2</p> </section> <section> <h1>標題3</h1> <p>內容3</p> </section> </body></html>
結果如下:
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/53/6B/wKioL1RnAc7zZv71AAA9FnaDwzs795.jpg" border="0" width="95" style="font-family:Helvetica, Arial, sans-serif;font-size:14px;white-space:normal;" />
中文出現亂碼,我們修改一下頁面編碼:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
結果如下:
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/53/6D/wKiom1RnAV6wDKgrAAA9FnaDwzs285.jpg" border="0" width="95" style="font-family:Helvetica, Arial, sans-serif;font-size:14px;white-space:normal;" />
HTML5學習:語義元素section