HTML body Tag Last Updated : 11 Jul, 2025 Comments Improve Suggest changes 14 Likes Like Report The <body> tag in HTML defines the main content of a web page and is always placed within the <html> tag as its last child. It contains everything that is visible on the page, including headings,paragraphs,images,links, tables, and lists.The <body> tag is required in every HTML document.If omitted, most browsers will still render the content as if the tag were present, but it’s not considered good practice.Syntax<body> Body Contents... </body>HTML Body Structure index.html <!DOCTYPE html> <html lang="en"> <body> <h3>GeeksforGeeks</h3> <p>This is paragraph text</p> </body> </html> OutputoutputAttributes There are many attributes in the <body> tag that are depreciated from HTML5 are listed below: Attribute ValuesDescriptionbackgroundIt contains the URL of the background image. It is used to set the background image.bgcolorIt is used to specify the background color of an image.alinkIt is used to specify the color of the active link.linkIt is used to specify the color of visited links.textIt specifies the color of the text in a document.vlinkIt specifies the color of visited links.Body tag with CSS implementation index.html <!DOCTYPE html> <html lang="en"> <body style="background-color:seagreen"> <h3>HTML body Tag</h3> <p> This is paragraph Tag and it's background-color is seagreen. </p> </body> </html> OutputoutputHTML <body> Tag Example with Hyperlink index.html <!DOCTYPE html> <html> <head> <title>HTML LINKS</title> </head> <body> <h2>Welcome To GFG</h2> <a href="https://www.geeksforgeeks.org/community/">GFG Community</a> </body> </html> OutputoutputHTML <body> Tag with Text Color Attribute index.html <!DOCTYPE html> <html> <head> <title>GFG color</title> </head> <body text="green"> <h2>Welcome To GFG</h2> <p>Body Text color changed to green.</p> </body> </html> OutputoutputBrowser Support Create Quiz Comment D DannanaManoj Follow 14 Improve D DannanaManoj Follow 14 Improve Article Tags : Web Technologies HTML HTML-Tags Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables9 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List5 min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like