+ 2

We can write even outside the <body> tag. So what is the importance of the body tag?

30th Jun 2017, 1:34 PM
Bhuvnesh
Bhuvnesh - avatar
4 Antworten
+ 11
Actually modern browsers auto correct, move every tags that should in head but not inside of head(meta,title,etc) element to head tag, and also body elements(p,img,etc) to body tag. May be some browser(Non modern browser, no html5 support) would run into error and display nothing on the web that not written their tags inside either head and body. How ever this answer is my estimate.
30th Jun 2017, 3:23 PM
Immanuel
Immanuel - avatar
+ 4
Once you get a little further on you start modifying your , , and tags, plus they keep your code more organized and easier to work with. There may be other reasons as well, but I'm not exactly a coding pro....yet. quoted from someones post in https://cheeze.club/x9q9
30th Jun 2017, 1:37 PM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 4
body tag is like the main function which are there in CLI languages
30th Jun 2017, 1:51 PM
Siddharth Saraf
+ 2
@Immanuel: Permissivity of Html5 is in specifications, and browers must implement the auto-correction feature as they are expected to display Html documents as well as they can, even with non valid ones... The problem is that from one browser to another you cannot predict if they all use the same implicits by correcting, and secondary that search engine don't like malformed document and should downrank your page/site :P
30th Jun 2017, 4:47 PM
visph
visph - avatar