tcooc
tcooc

Reputation: 21209

Using object as iframe

I heard that iframes are deprecated in HTML5, and object tags should be used instead. But the page does not load from the frame.

Im not familiar with object tags, do i need to specify a classid or type text/html? Here's the tag:

<object src="http://site.com/"></object>

Am I missing something, or has my browser(Chrome 6) not implemented this?

Upvotes: 1

Views: 733

Answers (2)

dmazzoni
dmazzoni

Reputation: 13236

You heard wrong, iframes are definitely part of HTML5.

You should never need to use iframes in order to lay out your own site. CSS and the Object tag eliminate the need for that.

However, there are plenty of good reasons for iframes, and for the example you gave above, just use an iframe - it will work on almost all browsers.

Upvotes: 1

meder omuraliev
meder omuraliev

Reputation: 186562

<object data="file.html" width=400 height=400></object>

There are certain bugs in IE if that matters, and workarounds for them. If you need IE it might be easier to just use an iframe.

Upvotes: 1

Related Questions