Re: Error in Checking invalid HTML code

> On Nov 21, 2022, at 6:09 AM, Richard.Mobbs <richard.mobbs@open.ac.uk> wrote:
> 
> Hi,
> 
> In checking my students work the following validated without any errors:

In recent versions of HTML, some elements/tags are optional and their absence won't be flagged as errors. The HTML Developer Spec has some explanation/examples:

https://html.spec.whatwg.org/dev/syntax.html#optional-tags

Of course, it can be confusing when the tags for the top level elements html/head/body are omitted and their existence is only implied. When teaching HTML, it is best to make those elements explicit.

- Chuck

Received on Tuesday, 22 November 2022 19:57:30 UTC