Re: Error in Checking invalid HTML code

> On Nov 22, 2022, at 3:11 PM, Jukka K. Korpela <jukkakk@gmail.com> wrote:
> 
>>  Chuck Houpt (chuck@habilis.net) wrote:
>> 
>> In recent versions of HTML, some elements/tags are optional and their absence won't be flagged as errors.
>> 
> Recent? The <html>, </html>, <head>, </head>, <body>, and </body> tags have been optional since the dawn of HTML.

[ Apologies for muddling element and tag in my first email. ]

By "recent versions", I mean HTML5/Living as compared to HTML4 (granted, 8 years is stretching "recent"). Specifically, a missing </body> tag is an error in HTML4-strict ("BODY" not finished but document ended), but not in HTML5.X/Living-HTML.

Of course, it is also true that a missing </body> tag is allowed in HTML 2,3,4-loose as well as 5 -- so maybe 4-strict is just an aberration (but a popular aberration).

- Chuck

Received on Saturday, 26 November 2022 20:51:14 UTC