W3C home > Mailing lists > Public > www-validator@w3.org > September 2017

Re: [www-validator] <none>

From: Jens Oliver Meiert <jens@meiert.com>
Date: Thu, 21 Sep 2017 15:13:32 +0200
Message-ID: <CAJ0g8QSNVGP==sEF03whugSDyU6V=VL_u1aVGsbObBTJVt=tMA@mail.gmail.com>
To: markdhamill@gmail.com
Cc: W3C WWW Validator <www-validator@w3.org>
> Thank you for this information. I wasn't aware the body tag was optional or
> the html tag for that matter. I am sure there is some good reason for this,
> but it seems inconsistent.

The sample document is inconsistent in its closing of elements,
however the specs aren’t that inconsistent once one considers HTML
parsing rules (for example, an <li> start tag really implies that
before it, any other <li> element must close).

There probably are additional overviews over optional tags but see
https://meiert.com/en/blog/optional-tags-in-html-4/ for an impression.
When omitting optional tags it seems useful to do so consistently and
omit all of them (unless there is ambiguity as with scenarios like
<p><img> vs. <p></p><img>, where the latter produces an anonymous
block element rendered differently from the former).

-- 
Jens Oliver Meiert
https://meiert.com/en/
Received on Thursday, 21 September 2017 13:14:18 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 21 September 2017 13:14:25 UTC