HTML5 include file [duplicate]

Solution 1:

Use the object tag:

<object name="foo" type="text/html" data="foo.inc"></object>

foo.inc should include valid HTML.

Note: do NOT use the self-closing <object/> style. That will prevent content after the tag from being displayed.

Solution 2:

<object> works fine, although it is not a self-closing tag, so it should look like this (otherwise it's not valid HTML5):

<object name="foo" type="text/html" data="foo.inc"></object>

<embed> can also be used for including external html content (and any MIME type):

<embed type="text/html" src="foo.inc">