HTML <section>
요소는 HTML 문서의 독립적인 구획을 나타내며, 더 적합한 의미를 가진 요소가 없을 때 사용합니다. 보통 <section>
은 제목을 포함하지만, 항상 그런 것은 아닙니다.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
참고: 요소의 콘텐츠를 외부와 구분하여 단독으로 묶는 것이 나아보인다면 {{htmlelement("article")}} 요소가 더 좋은 선택일 수 있습니다.
콘텐츠 카테고리 | 플로우 콘텐츠, 구획 콘텐츠, 뚜렷한 콘텐츠. |
---|---|
가능한 콘텐츠 | 플로우 콘텐츠. |
태그 생략 | {{no_tag_omission}} |
가능한 부모 요소 | 플로우 콘텐츠를 허용하는 모든 요소. 단, <section> 요소는 {{HTMLElement("address")}}의 자손이 될 수 없습니다. |
가능한 ARIA 역할 | {{ARIARole("alert")}}, {{ARIARole("alertdialog")}}, {{ARIARole("application")}}, {{ARIARole("banner")}}, {{ARIARole("complementary")}}, {{ARIARole("contentinfo")}}, {{ARIARole("dialog")}}, {{ARIARole("document")}}, {{ARIARole("feed")}}, {{ARIARole("log")}}, {{ARIARole("main")}}, {{ARIARole("marquee")}}, {{ARIARole("navigation")}}, {{ARIARole("search")}}, {{ARIARole("status")}}, {{ARIARole("tabpanel")}} |
DOM 인터페이스 | {{domxref("HTMLElement")}} |
이 요소는 전역 특성만 포함합니다.
<section>
을 식별할 수단이 필요합니다. 주로 제목({{htmlelement('h1')}}-{{htmlelement('h6')}}) 요소를 <section>
의 자식으로 포함하는 방법을 사용합니다.<section>
요소를 일반 컨테이너로 사용하지 마세요. 특히 단순한 스타일링이 목적이라면 {{htmlelement("div")}} 요소를 사용해야 합니다. 대개, 문서 요약에 해당 구획이 논리적으로 나타나야 하면 <section>
이 좋은 선택입니다.<div> <h2>Heading</h2> <img>some image</img> </div>
<section> <h2>Heading</h2> <img>some image</img> </section>
명세 | 상태 | 주석 |
---|---|---|
{{SpecName('HTML WHATWG', 'sections.html#the-section-element', '<section>')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5.1', 'sections.html#the-section-element', '<section>')}} | {{Spec2('HTML5.1')}} | |
{{SpecName('HTML5 W3C', 'sections.html#the-section-element', '<section>')}} | {{Spec2('HTML5 W3C')}} |
{{Compat("html.elements.section")}}