4
votes

I am loading contents into a same domain iframe. Does the html file that I am loading contents from need the head body html tags, or can i just put my content in a div and not worry about having it be a full page on its own? It will never be accessed on its own, and seems to work without those tags, but to work with all browsers are those tags necessary?

Thanks!

3

3 Answers

4
votes

Treat it just like any other complete web page.

2
votes

While it may work without them, it's both semantically and syntactically better to include them.

0
votes

head, body and html tags are all optional in HTML anyway, so you're not doing anything wrong there.

You should probably include a title element though. It's required for validity and may help with SEO if nothing else.