W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2009

[whatwg] Closing tags for empty content model

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 28 Sep 2009 21:21:11 -0500
Message-ID: <dd0fbad0909281921q19c78444t3bdaf01334813516@mail.gmail.com>
On Mon, Sep 28, 2009 at 9:18 PM, Marius Gundersen <gundersen at gmail.com> wrote:
> Shouldn't you always close the tags, either self-closing or with a separate
> close tag? That is, this is the correct way to do it:
>
> <video width="640" height="360" style="color:red">
> ?<source src="bunny.ogv" type="video/ogg" />
> ?<source src="bunny.mp4" type="video/mp4" />
> </video>
> <p>Text after the video element.</p>

In the HTML syntax of HTML5, no, void elements do *not* have to be
explicitly closed.  You *can* put the trailing slash on them, but it
doesn't do or mean anything; it's simply ignored.

~TJ
Received on Monday, 28 September 2009 19:21:11 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:52 UTC