Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't understand: since when are those structure tags optional, and in what browsers and browser versions would this work in?


I believe they've been optional in every version of HTML.

The example document in the HTML+ spec (1993) did not use them: https://www.w3.org/MarkUp/HTMLPlus/htmlplus_7.html

The HTML 2.0 spec gives this as its first example:

    <!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <title>Parsing Example</title>
    <p>Some text. <em>&#42;wow&#42;</em></p>


The very first draft HTML spec, https://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt (June 1993), is somewhat interesting here, because the only element with optional start and end tags is the html element (head and body require both start and end tags, per that spec).

Certainly by the point of HTML 2.0 (November 1995; the first non-draft spec for HTML) all three elements have start and end tags all optional.

The more general ability to omit start/end tags from given elements is a feature of SGML (October 1986), and HTML 2.0 to HTML 4.01 were defined as SGML applications (though approximately nothing ever used an SGML parser for HTML).


The HTML5 specification says where they're optional, so any browser that properly implements the spec


So I'm supposed to assume a browser properly implements a specification?


Yes, that's the point of having a set of standards. Otherwise you end up with an IE situation where everyone just develops for a single browser.


Otherwise you end up with a Chrome situation where everyone just develops for a single browser.

You're commented needed to modified for current times. ;-)


Chrome is based on Webkit which is free and open source so that is a terrible analogy with IE that was proprietary.


Its being open source isn’t mutually exclusive with its not adhering to the standard


Chrome uses its own Blink and V8 now, and there are many cases where developers only design for Chrome and small differences in implementation can be a huge pain in Firefox/Safari.


Blink is also under a FOSS license so I am not sure what the problem is. Competiting browsers use Blink as well.


If it was that simple there would be no reason for Safari to lag behind.


No professional developer targets a browser when developing a web site unless its a captured audience with no choice. Professional developers follow the specification. Those who do otherwise are only mentioned in reddit headlines and other hobbyist sites.


I understand that's the intent of standards, but rarely are there not limitations or bugs in implementations.

If this was truly the case, we wouldn't need things like Applitools to view our HTML documents in various browsers to scan for differences.


That's what we do every day we use any browser out there.


Well, that is literally the point of a specification.


You're missing my point. Assuming that all browsers correctly implement the specification is naive. I don't have an issues with standards themselves existing.


Isn't this what you'd be doing in any case?


They are implied. I believe this dates back to when browsers supported non-standard HTML and the behavior of doing it was cemented in HTML5 (like tag soup and so forth.) Since it was based on existing behavior it should work even in old IE, just like the doctype.


Since pretty much forever. HTML 4 for sure, probably even earlier.


From the slug of this page it seems since 2011? https://www.w3.org/TR/2011/WD-html5-20110525/syntax.html#opt...

Note though that there are some conditions.


It's been allowed since long before then, all the way back to the og html 4.01 spec in 1999


All the way back to HTML 2.0, which was the first non-draft HTML spec.


I see. Today I learnt something new!




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: