HTMLs Tutorial

HTML Tutorial HTML Tags HTML Basic Tags HTML Attributes HTML Elements HTML Formatting HTML Text Format HTML <body> tag HTML <samp> tag HTML <script> Tag HTML <section> tag HTML <select> tag HTML <source> tag HTML <span> tag HTML <strike> tag HTML <strong> tag HTML <style> tag HTML <sub> tag HTML <summary> tag HTML <sup> Tag HTML <svg> tag HTML <table> tag HTML <u> tag HTML Headings HTML Paragraphs HTML <wbr> tag HTML Anchor HTML Image HTML Lists HTML Ordered List HTML Unordered List HTML Form HTML Form input HTML with CSS HTML Layouts HTML References HTML Frames HTML Links

HTML5 Advance

HTML5 Tutorial HTML5 Tags HTML<Button>Tag HTML <canvas> Tag HTML<caption> Tag HTML City tag HTML <Data> Tag HTML5 SVG HTML Event Attribute HTML5 Audio HTML5 Youtube HTML5 Button Tag HTML5 Tags

Misc

How to add JavaScript to HTML How to change font in HTML How to change text color in HTML HTML Date HTML Hide Element HTML Nested Table HTML Reset Button What does HTML stand for? HTML Background Image HTML <address> Tag Div Tag in HTML How to insert Image in HTML How to create a link with no underline in HTML How to insert spaces/tabs in text using HTML/CSS HTML <br> tag HTML Code HTML <video> Tag HTML Canvas Design a tribute page using HTML and CSS What is a Container tag Font tag in HTML Difference between HTML and DHTML Empty Tag in HTML HTML Button Link Html Line Break Img src HTML Nested List in HTML Placeholder in HTML TD in HTML HTML Space Code HTML Target Attribute HTML
Tag Markup Meaning in HTML Border-Collapse in HTML HTML Onclick

HTML <section> tag

The section element in HTML is used to define sections in a document.

Syntax of Section Tag:

<body>
<h1>……….</h1>
<section>
<h2>……….</h2>
<p> …………………………</p>
</section>
<section>
<h2>………..</h2>
<p>…………………………. <p>
</section>
</body>

Examples of Section Tag

Example 1:

In this example, we use the HTML "section" element for defining the two sections on the web page:

<!DOCTYPE html>
<html>
<head>
<title> html section tag </title>
</head>


<body>
<h1> here is the section tag example </h1>
<section>
<h2> preview of this document data part-1 </h2>
<p> Lorem, ipsum dolor sitametconsecteturadipisicingelit. Natus, reprehenderitea rerum eaquequidemut
exercitationemullamvelit dolor modi! Ducimusmagniiure autem itaquepraesentiumrepellendusnecessitatibus
dignissimos at!
</p>
</section>
<section>
<h2> preview of this document data part-2 </h2>
<p> Lorem ipsum, dolor sitametconsecteturadipisicingelit. Aliquam hic dignissimos vitae error alias dolor
magniinventore quo temporibusrepudiandae. Exercitationemducimus fugit iure. Nesciuntatqueiustomagni ad
aliquid?   
</p>
</section>
</body>
</html>

Output:

HTML Section Tag

Example 2:

Here, we are going to declare three sections in a html document with the help of html section tag:

<!DOCTYPE html>
<html>
<head>
<title> html section tag </title>
</head>
<body>
<h1> here is the section tag example </h1>
<section>
Lorem ipsum dolor sit ametconsecteturadipisicingelit. Deserunt, exercitationem hic. Doloremquevoluptasmodi, consequunturquidempariaturinciduntreprehenderitenim delectus. Praesentiumnequeexcepturiearumharumillo ad.
</section>
<section>
Lorem ipsum dolor sit ametconsecteturadipisicingelit. Est, saepe in. Impedit vel natus, asperiores, doloremaliquamblanditiisvoluptas, nostrum rationeharum error ipsam sed consequatur rerum doloribusnesciuntaccusantium.
</section>
<section>
Lorem ipsum dolor sit ametconsecteturadipisicingelit. Alias dicta quos estquaeratmodi, nobis mollitiavoluptatibus! Eumharumeaquecupiditatequia, pariaturblanditiis at, quis illum alias veniamquaerat?
</section>
</body>
</html>

Output:

HTML Section Tag

Example 3:

Here, we are going to declare one section in a html document with the help of html section tag:

<!DOCTYPE html>
<html>
<head>
<title> html section tag </title>
</head>
<body>
<h1> here is the section tag example </h1>
<section>
<h2> preview of this document data part-1 </h2>
<p> Definition and Usage
For defining section in html document, we use the <section> tag in html.
Example
Example 1:
Here, in this example we are going to declare two sections in a html document with the help of html <section> tag: </p>
</section>
</body>
</html>

Output:

HTML Section Tag

Browser support:

List of browsers that support html section tag are mentioned below:

Chrome: Yes – version 5 needed

Microsoft Edge: Yes– version 12 needed

Firefox: Yes– version 4 needed

Safari: Yes– version 5 needed

Opera: Yes– version 11.1 needed

Default CSS Settings

The following CSS values are saved as default in most of the browsers for defining the section tag:

Example

section {
  display: block;  
}