0

I am not using head tags and still it was running why ?

https://code.sololearn.com/W5mdVZmEC0L1/?ref=app

5th Apr 2020, 7:35 AM
Saurabh Sen
Saurabh Sen - avatar
4 Respostas
+ 1
AKR why it is not giving any error
5th Apr 2020, 7:41 AM
Saurabh Sen
Saurabh Sen - avatar
+ 1
Html is a permissive language. Browsers are intended by the officiial specifications to handle invalid html code as well as they could (somethings are relatively predictable as auto-correction, but others less). So if your Html is as simple as a simple sentence without any tags, your browser will build the minimal valid structure for it and embed that sentence in the implicit body part... That's the case too for an implicit head part build for you, but as this is an invisible part of your document for the user, you didn't notice it (open the developper tools of your browser and inspect the page: you will see a full html valid structure even if your code doesn't provide one! That behavior is for improve user experience (think of the numberous web page wich will fail to run/display if Html was not permissive): and browsers vendors are ok with that point of view ^^
5th Apr 2020, 11:12 AM
visph
visph - avatar