HTML Basics

HTML Introduction HTML Basic HTML Comments HTML Tags/Elements HTML Attributes HTML Formatting HTML Block and Inline HTML Charsets HTML Classes HTML Colors HTML Div HTML Headings HTML Id HTML Iframes HTML Images HTML File Paths HTML Tables HTML Layout HTML Lists HTML Links <a> HTML Paragraphs HTML Quotations HTML JavaScript HTML Emojis HTML URL Encode HTML Entities HTML Computercode HTML Symbols HTML Styles

HTML Forms

HTML Forms HTML Form Elements HTML Form Attributes HTML Input Attributes HTML Input Regex HTML Input Form Attributes HTML Input Types

HTML SEO

HTML Head HTML Page Title HTML Responsive HTML Semantics HTML Favicon

HTML Graphics

HTML Canvas HTML SVG

HTML Media

HTML Media HTML Audio HTML Video

HTML Reference

a abbr acronym address applet area article aside audio b base basefont bdi bdo big blockquote body br button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl DOCTYPE dt em embed fieldset figcaption figure font footer form frame frameset h1_-_h6 head header hgroup hr html i iframe img input ins kbd label legend li link main map mark menu meta meter nav noframes noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script search section select small source span strike strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr
HTML <code><body></code> Tag

The HTML <body> Tag

The <body> tag in HTML is used to define the main content of a webpage. It contains all the visible content such as text, images, links, and other elements that are displayed on the page.

Usage of the <body> Tag

The <body> tag is a required tag in HTML documents and is used to encapsulate all the content that will be displayed on the webpage. It is placed within the <html> tag and comes after the <head> tag.

Main Attributes of the <body> Tag

The <body> tag does not have many attributes, but it does have a few key attributes that can be used:

Attribute Description
bgcolor Sets the background color of the webpage
text Sets the default text color of the webpage
link Sets the color of links that have not been visited
vlink Sets the color of links that have been visited
alink Sets the color of links when they are being clicked

Examples of <body> Tag

Here is an example of how the <body> tag is used in an HTML document:


            <html>
                <head>
                    <title>My Webpage</title>
                </head>
                <body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
                    <h1>Welcome to My Webpage</h1>
                    <p>This is the main content of my webpage.</p>
                    <a href="https://www.example.com">Click here</a> to visit my website.
                </body>
            </html>