You are on page 1of 10

Elements of body tag and

attributes
ARTHIKA(20BCC503)
Introduction

HTML (Hypertext Markup Language) is the foundation of any web page,


and the body tag is one of the most critical elements of HTML. The
body tag defines the main content area of a webpage and contains all
the content that users can see and interact with. In this seminar, we will
explore the various elements and attributes of the body tag in HTML.
Body Content:
1. The structure of the Body Tag: The body tag is an essential element
of the HTML structure, and it comes after the head tag. It
encompasses all the content that appears on the webpage,
including text, images, and videos.
2. The role of the Body Tag: The body tag is a container for all the
visible elements on the webpage. It provides the structure for the
content, allowing for a seamless layout of images, videos, text, and
other elements. The body tag also contains the scripts that make
web pages interactive.
Cont…

3. Understanding the Attributes of the Body Tag: Attributes provide


additional information about an HTML element, and the body tag has
several attributes. These include background, text color, link color, and
font type. Each attribute serves a unique purpose in defining the
appearance of the webpage.
4. Styling the Body Tag: Styling the body tag is critical for the overall
appearance of the webpage. CSS (Cascading Style Sheets) is used to
style the body tag by modifying its attributes. This can be done by using
inline styles or by linking external style sheets.
Cont…
5. Best Practices for using the Body Tag: To create an efficient and user-
friendly webpage, there are best practices to follow when using the
body tag. These include organizing the content into logical sections,
using descriptive and meaningful headings, and optimizing the images
and videos.
HTML <body> Tag

We all know that HTML is basically used to build websites that are
available on the internet. HTML consists of series of elements like
<head> tag <title> tag, etc that are used to structure the web page. One
such element that is a home for all the other contents of the webpage
such as headings, paragraphs, images, tables etc. is HTML <body> Tag.

All the content inside the <body> tag is only visible on the webpage.
EXAMPLE
<html>
<head>
<title>Title of the WebPage</title>
</head>
<body>
<p> Everything inside the body tag is visible on the web page</p>
</body>
</html>
OUTPUT
As shown in the example, the <body> tag is always enclosed
within the <html> tag and there can be only one <body> tag in
the whole webpage. It is usually present after the <head> tag.
The content in the tag is written between the opening
(<body>) and closing (</body>) tags.
THANKYOU

You might also like