HTML <section> tag

Updated: 11/13/2018 by Computer Hope
HTML section tag

When writing in HTML (hypertext markup language), the <section> tag is a block element used to group thematically similar content together. Examples are generic documents and application sections. As a general rule, <section> shouldn't be used if there is no natural <heading> for it. The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.

Note

This element is unique in that it is a phrase tag, which indicates that a section of text has structural meaning.

Tip

The <section> tags should not be used for styling, instead use the <div> tags for styling changes. If the content that would be contained in the <section> tag relates to other portions of the page with its own heading, consider using the <section> tags.

Example of <section> code

<section>
<h1>Heading</h1>
<p>Document content</p>
</section>

Example result

Heading

Document content

Attributes

All HTML tags support standard attributes that define the settings of an HTML element. Unlike other HTML tags, the <section> tag has no unique attributes.

Compatibility

Edge Internet Explorer Firefox Safari Opera Chrome
All versions 9.0+ 4.0+ 5.0+ 11.1+ 5.0+

Additional phrase tags

Browser, Compatibility, Container tag, CSS, HTML article tag, HTML div tag, HTML nav tag, Web design terms