スペースを分割するHTMLタグ

9611 ワード

Webレイアウト

  • モダンネットワークでは、主にdivラベルを使用してレイアウトを整理します.
  • 📝コード#コード#
    <!DOCTYPE html>
    <html>
      <head>
    	<meta charset="UTF-8">
    	<title>HTML Layouts</title>
    	<style>
              #header {
                  background-color: palegoldenrod;
                  color: white;
                  width: 700px;
                  height: 100px;
              }
              #nav {
                  background-color: lightskyblue;
                  color: white;
                  width: 100px;
                  height: 300px;
                  float: left;
              }
              #section {
                  background-color: lightgreen;
                  color: white;
                  width: 600px;
                  height: 300px;
                  float: left;
              }
              #footer {
                  background-color: plum;
                  color: white;
                  width: 700px;
                  height: 100px;
                  clear: both;
              }
    	</style>
      </head>
      <body>
        <div id="header"><h2>Header 영역</h2></div>
    
        <div id="nav"><h2>Nav 영역</h2></div>
    
        <div id="section"><h2>Section 영역</h2></div>
    
        <div id="footer"><h2>Footer 영역</h2></div>
      </body>
    </html>
    💻結果

  • しかしdivタグには의미론적으로の意味はなく、HTML5に新たに出現したSematic 요소が存在する.

  • headerドキュメントのヘッダー
  • navドキュメント内のリンクの組合せ
  • aside側スペース
  • sectionドキュメントの領域の定義
  • article節の主な内容を含む空間
  • footer文書脚注の定義
  • 参照
    IEの中にはHTML5 Sematic 요소が正常に動作していないものもあります.

    Reference

  • https://www.w3schools.com/