공간을 분할하는 HTML 태그

jiseong·2021년 7월 28일
0

T I Learned

목록 보기
5/291

웹페이지의 레이아웃

  • 모던 웹에서는 주로 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 요소들이 존재.
    sematic  elements

  • header 문서의 머릿말

  • nav 문서 내의 링크들의 조합

  • aside 사이드에 위치하는 공간

  • section 문서의 구역을 정의

  • article 분문의 주내용이 들어가는 공간

  • footer 문서 바닥 글을 정의

❓ 참조
IE에서 일부 HTML5 Sematic 요소는 잘 작동하지 않음.


Reference

0개의 댓글