×

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 Reset Button

The HTML reset button is used to reset all values in the form. It clears all input fields. Reset is the value of the type attribute of the button element. The...

6 minutes read.

HTML Hide Element

The HTML hide element is used to hide the element. We place the hidden attribute inside those elements which we want to hide. The hidden attribute is a Boolean attribute. The...

3 minutes read.

HTML Unordered List

In HTML, we have <ul> tag which defines the unordered list. And it is also known as bulleted list, because as we know it is not ordered list therefore it...

2 minutes read.

HTML Images

HTML has <img> tag to display image on the web pages or web application. This tag is an empty tag i.e. we don't have to close this tag while using. SYNTAX: <img src="source address" attributes="alt, height, width"> Example: <html>   <body>   <center>Image tag Example</center>   <img src="https://www.tutorialandexample.com/resources/images/favicon.png"    alt="tutorialandexample"/>   </body>   </html> Output: Image...

1 minute 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 SVG

HTML SVG: SVG stands for Scalable Vector Graphics which defines the graphics for the web. It is a language for describing 2-D graphics in XML. Each drawn shape in SVG is...

1 minute read.

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...

3 minutes read.

HTML Elements

An HTML element is nothing but a starting tag and then some content and then the closing tag. So we can say HTML elements is everything from the starting tag...

3 minutes read.

HTML Date

The input element in HTML has several attributes. One of its attributes is the type attribute which creates a calendar in an order that a user can select a date...

5 minutes read.

HTML Text Format

Introduction HTML may format text in two different ways. The HTML tags define a text property to make it appear one way or another. A text element may also be formatted...

7 minutes read.

HTML <select> tag

This tag helps in making the drop-down list on the web page. This is highly used in HTML forms for taking the input from user. You can use the id attribute...

3 minutes read.

Font tag in HTML

HTML stands for Hypertext Mark-up Language and is used to create web pages and other information that can be later displayed in a web browser. It also consists of a...

4 minutes read.

HTML City tag

HTML <City> tag HTML < cite > tag specifies a citation, a reference or title to a creative work, quoted content, books, websites, a research paper, a blog post, a painting,...

3 minutes read.

HTML Code Tag

The code tag in HTML is a phrase tag used to insert a piece of computer programming code. In HTML there is a separate tag named as <code> tag. Sometimes,...

3 minutes read.

HTML Data Tag

HTML Data Tag: The HTML < data > tag is used to transmit its content to a machine-readable version. The data are presented in a particular format. It is useful...

3 minutes read.

HTML Youtube

<object> element: It embed the object within the HTML documents and embed plug-ins such as Java applets, PDF readers, Flash Players etc in web pages. Example: <object width="100" height="100" data="bookmark.swf"></object> <embed> element: It defines an embedded...

1 minute 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.

Most Commonly used Tags in HTML

In this tutorial, we'll look at the most popular HTML tags. We know HTML is a fundamental requirement for creating a website. As a result, it is essential to remember...

9 minutes read.

HTML5 Button Tag

HTML Button Tag The < button > tag is used on the webpage to construct a clickable button inside the HTML. Within the < button>....</button > tag, we can place content...

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.