Table of contents
No headings in the article.
What is it all about?
There are various reasons, to embed an element in a page. These days it is especially video that is embedded, pdf documents and to some degree other things, but those are not the only uses.
In the late 1990's, frames, an earlier version of the current IFRAME tag, was all the rage, as it offered some possibilities for design, that hadn't been possible before. Today frames are only used on a very few and old websites, to some extent because the tag was removed in HTML 5. Embedding we still use a lot, and for that we have the three tags OBJECT(object is disprecated in HTML5 so we will not talk about that), EMBED or IFRAME. They basically do the same, but you should be aware that this tags have some minor differences that may make one better to use that the other, when coding. In general, IFRAME is currently the most populat tag, and EMBED is supposedly being deprecated. The three tags can handle video, but here it is generally better to use the VIDEO tag, as the was created specifically for this particular use.
Using IFRAME
The tag IFRAME is extremely simple. The syntax to make it work is:
<IFRAME SRC="FileName"></IFRAME>
Note that though it has both a start and end tag, it has no content. Also, you don't have to specify the type as you have to do with EMBED. You can write something or insert images, if you want to. That will just be shown below the content being linked to in the SRC attribute.
Attributes
You can read here about the attributes in detail IFRAME-attribute
Using EMBED
EMBED is basically the same as IFRAME, only with fewer attributes Hence it has less modification compair to IFRAME. Formally, EMBED is an HTML 5 tag, but on several browsers it will also work for HTML 4.01, if you are using this. It just cannot be validated. As always HTML 5 is recommended for the pages.
The syntax to make EMBED work is
<EMBED SRC="FileName">
You can read here about the attributes in detail EMBED-attribute
CONCLUSION
Both tags have there uses but it is prefered to use video tag for video file and audio tag for audio file over embed tag. IFRAME have more attributes compair to EMBED there for IFRAME gives you more control over the desire output and IFRAME is more advance then a EMBED . We can discuess more on it in comments .!!
That's all from my side - Please correct me, if I am wrong at any place, I will appreciate that I am in learning phase hope this will be helpful to you also.