×

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;  
}

Related Topics

HTML Ordered List

We use <ol> tag to make an ordered list in html. An ordered list is made to make a list of items in ordered form, ordered list can be either...

3 minutes read.

Html &lt;center> Tag

The term HTML refers to Hyper Text Markup Language. The most widely used markup language for making web pages is HTML. A structure of web page is described in HTML....

3 minutes read.

HTML Search Box

The HTML search box is also known as the search bar. It is an input text field that is used to search the content. If the users want to explore...

7 minutes read.

HTML Id Attribute

The HTML id attribute represents the unique identifier for an element of the HTML document. Each element has its unique identifier. The id attribute is a global attribute that can be...

12 minutes read.

Div Tag in HTML

In HTML, ‘div’ is a tag that specifies division or section in HTML document. But before going in detail of it, let’s first understand about tags in HTML. The tag...

8 minutes read.

Html &lt;dd> Tag

In an HTML description list, an item's definition or description is indicated using the definition description ("dd" tag). A <dd> tag can contain paragraphs, line breaks, images, links, and lists. It...

4 minutes read.

What does HTML stand for?

HTML stands for Hyper Text Markup Language. We use this markup language to design a web page. Web browsers use this language to showcase text, videos, images, audio and other...

6 minutes read.

HTML <summary> tag

When we simply want to show the primary heading or topic name of hidden detailed material to users, then we can achieved this by using the summary tag. This makes it...

2 minutes read.

HTML Form Action

The <form> tag has an attribute named action that contains a URL. The HTML action attribute defines the webpage URL on which you want to send the data after submitting...

4 minutes read.

HTML Lists

HTML List HTML lists are used to specify data sets. All lists can include one or more elements from the list. HTML lists are available in three different types: Ordered List or...

4 minutes read.

How to add Google Translate Button on your Webpage?

Google translator is a multi-language translator used for translating the webpage. Google develops it. In today's digital age, it is essential because information is available worldwide in some specific language...

5 minutes read.

HTML Font Size

The HTML <font> tag uses the size attribute to specify the size of the text. We can set the size attribute’s value from 1 to 7. The default size of...

4 minutes read.

HTML Charsets

In this tutorial, we are going to discuss about the charsets in the HTML. The letters, numbers, and several other symbols are shown correctly by the web browser. All of this...

2 minutes read.

HTML <address> Tag

Hyper Text Markup Language, HTML is the best markup language for creating Web pages. HTML consists of a wide variety of elements. In all of these elements, one element is...

4 minutes read.

HTML Canvas

HTML Canvas: Using JavaScript, the < canvas > tag in HTML is used for drawing graphics on web page. It can be used to draw routes, boxes, text, gradient, and...

3 minutes read.

HTML References

BASIC HTML TAGS TAGS DESCRIPTION <!DOCTYPE> Defines Document Type <html> Defines Html document <head> Defines Header of document <title> Defines Title of document <body> Describe all the content of document <h1> to <h6> Defines Html Heading <p> Write Paragraph in this tag <br> Line break <!--...--> Comment in Html FORMATTING TAGS TAGS DESCRIPTION <abbr> Defines...

3 minutes read.

HTML <u> tag

Underline Element/Tag: The u tag in html is used to specify the important text or phrase by underline. In earlier HTML versions, this element was known as the "Underline" element, and...

5 minutes read.

HTML Frames

Frames in Html is used to divide the browser into different sections where each section can load different Html documents. Collection of frame is known as Frameset. Creating frames:We use frameset...

2 minutes read.

Html Wbr Tag

The Line Break Opportunity element A word break opportunity is a place in text from where the browser breaks a line. This opportunity is represented by the element wbr in the...

2 minutes read.

What is a Container tag?

In HTML, there are different types of tags or say instructions which make the developer specify various elements in the document and make the browsers understand what to display. Tags in...

5 minutes read.