Search code examples
htmlvalidationminimum

Is this minimalist HTML5 markup valid?


<!DOCTYPE html>
<meta charset="utf-8">
<body>
Hello, world!

SOURCE FOR CODE

If so, besides removing "Hello, world!" is there any tag that's able to be removed and it still be valid, and how do you know it's still valid?


Solution

  • It's not valid. To check it you can run it in W3C Validator

    The error is: Element head is missing a required instance of child element title.

    ...

    UPDATE

    As vcsjones stated the head element is optional. That's the title one is required. Credit to mootinator for pointing out that the body is also optional.

    So the simplest valid document will be:

    <!DOCTYPE html>
    <title></title>