<body> Tag : Content of Webpage
The <body>
tag in HTML defines the main content of a web page. All the visible elements on a web page, such as text, images, tables, links, and more, are placed within the <body>
tag.
Here's an example of how the <body>
tag can be used in an HTML document:
<!DOCTYPE html>
<html>
<head>
<title>My Page Title</title>
</head>
<body>
<h1>Welcome to my website</h1>
<p>This is some sample text on the page.</p>
<img src="image.jpg" alt="An image">
<a href="http://panditprogrammer.com">Click here for more information</a>
</body>
</html>
In this example, the <body>
tag contains a heading, a paragraph of text, an image, and a hyperlink. This is just a simple example, but you can use the <body>
tag to include a wide range of HTML elements to create complex and sophisticated web pages.
It's important to note that the <body>
tag should come after the <head>
tag in an HTML document, as the <head>
section contains meta information about the document, such as the title of the page and any CSS styles that should be applied. The <body>
section, on the other hand, contains the main content of the page that is visible to the user.