Description

The HTML element <section> is used to define a section in an HTML document, such as header, footer, etc.,

The below table summarizes its usage.

Usage Details
Placement It is displayed as a Block element.
Contents It can contain Block elements, Inline elements, and text.
Tags Both the opening and closing tags are required.
Versions HTML 5

Syntax

Here is the basic syntax of the <section> element.

<section>...</section>

Examples

Run this on IDE

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Example - HTML Element section</title>
</head>
<body>
    <h1>Document Sections<h1>
    <section>
        <h2>Section One<h1>
        <p>Content of section one goes here, which can extend to multiple lines.<p>
    </script>
    <section>
        <h2>Section Two<h1>
        <p>Content of section two goes here, which can extend to multiple lines.<p>
    </script>
</body>
</html>

Attributes

The following table shows the list of supported and unsupported attributes for the <section> element.

Attribute Type Details
Element-Specific Attributes The tag <section> doesn't have any element-specific attributes.
Global Attributes Like all other HTML tags, the tag <section> supports the HTML Global Attributes.
Event Attributes The tag <section> also supports the HTML Event Attributes.

Browser Compatibility

The tag <section> is supported in all modern browsers.

  • Google Chrome 6+
  • Internet Explorer or Edge 9+
  • Firefox 4+
  • Apple Safari 5+
  • Opera 11.1+

Related Links