Byungchan An
Byungchan An

Reputation: 13

HTML5 iframe in HTML4 document

Is it possible to include iframe with HTML5 format inside HTML4 document? Then, will HTML5 features work as expected? Or, will root document restrict the HTML5 features?

Upvotes: 0

Views: 953

Answers (2)

Steyn
Steyn

Reputation: 1321

The doctype declaration will not restrict the elements if the browser needs to support the element.

https://html5test.com/results/desktop.html Source: HTML 4 Iframe with HTML5 content

So, answering your questions:

  • Yes it is possible to do this.

  • Yes all features will work, if the browser supports it.

  • No there will be no restrictions because of the document.

Upvotes: 2

Normally, it will be. Frame rendering is independent of the parent page, so I think you will be able to load almost any page, even HTML5, in a frame on a root page with an older !DOCTYPE.

Upvotes: 0

Related Questions