Why we use it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why we use it?

31st Dec 2022, 9:45 AM
Majibul Hoque Ahmed
3 Answers
+ 4
Because without <body> we would look stupid like an octopus 🐙 Anyway, programming languages have rules, because computers can only follow precise instructions. It is a rule, how a HTML document structure must be composed, and the <body> tag is an essential element there, it contains everything that is shown to the viewer of the page.
31st Dec 2022, 10:05 AM
Tibor Santa
Tibor Santa - avatar
+ 2
Yep, Tibor Santa is right. We need the <body> tag since it is vital and helps to structure a HTML page properly. A typical HTML page structure is this: <html> <body> </body> </html> All the main content that will go on the page goes under the <body> tag. It is also a way of making code more readable (well in my opinion mostly).
31st Dec 2022, 10:59 AM
Hassanah
Hassanah - avatar
+ 2
body tag is the body part of the website In the body part we write the view things writing in that contains show in the users example: <html> <head> <!--In this part use for linking the stylesheet and make a title and etc.. --> <title>Hai</title> </head> <body> <p>Hello world</p> </body> </html>
31st Dec 2022, 2:57 PM
Muhammed Shibil M
Muhammed Shibil M - avatar