How to use section tag in html
This Blog You Will Learn
ஃ What is the <section> tag
ஃ Why Use the <section> tag?
ஃ Syntax of HTML <section> tag
ஃ Explain Program
ஃ Output
What is the <section> tag
✅ HTML <section>tag is semantic HTML element.
✅ HTML <section> tag used to define a thematic group of content on a webpage.
✅ HTML <section> represents a separate part of webpage.
✅ <section> tag use to group related content together under a common theme.
Why Use the <section> tag?
✔ Organizing content logically.
✔ Creating clean and maintainable code.
✔ Making content easier for screen readers.
✔ Improving website readability.
✔ Enhancing SEO with semantic structure.
Syntax of HTML <section> tag
<section>.......</section>
<section>.......</section>
how to use section tag in html
Example
<!DOCTYPE html>
<html>
<head>
<title> html section tag</title>
</head>
<body>
<h1> HTML Section tag</h1>
<h2> What is the html tag</h2>
<section>
<p>
An HTML tag is a building block of a web page used to define
elements and structure content in HTML (HyperText Markup Language).
Tags are usually written within angle brackets, like tagname, and
often come in pairs: an opening tag p and a closing tag /p,
with the content placed in between. Some tags, like img or br,
are self-closing and do not need a closing tag. HTML tags tell the
browser how to display text, images, links, lists, tables, and other
content. Learning tags is essential to create, format, and structure
websites effectively </p>
</section>
<section>
<h3> Why learn html language </h3>
<p>HTML (HyperText Markup Language) is the foundation of the web,
used to structure content on websites. Learning HTML is essential
for creating web pages, adding headings, paragraphs, images, links,
and other elements.beginner-friendly and easy to learn,
making it the first step for anyone interested in web development.</p>
</section>
</body>
</html>
how to use section tag in html
Explain Program
Step 1]
<!DOCTYPE html>
- This declare the document type.
- browser that the document is written in html
Step 2 ]
<html>.... . </html>
- html is the root element of the html page.
- Every thing inside it is part of the webpage.
Step 3]
<head>
<title> HTML iframe tag </title>
</head>
- <head> section
- head section contains metadata about page. not visible on the page itself.
- <title> tag title section set the title of the page shows the browser tab.
Step 4]
<body>
<h1> HTML Section tag</h1>
<h2> What is the html tag</h2>
.
.
.
</body>
- <body> body contains the visible content webpage.
- html <h1> tag heading.
- html <h2> tag subheading tag.
Step 5]
<section>
<p>
An HTML tag is a building block of a web page used ....... </p>
</section>
- html <section> tag defines a section of related data content.
- inside section tag <p> tag for paragraph.
- section help organize content semantically.
Step 6]
<section>
<h3> Why learn html language </h3>
<p> HTML (HyperText Markup Language) is the ..... </p>
</section>
- html <h3> tag smaller heading <h2>.
- html <p> tag paragraph of text.
Step 7]
Closing tag
</section>
</body>
</html>
how to use section tag in html
