Html object & embed tags

Maybe almost 90 % of the web developers world wide are using widely the <embed> and <object> HTML tags, but in the most cases do not understand the semantics and syntax of them.

Very well known is that these tags help to put a flash movie into the HTML, but why they are two, and can they be used in other cases remains unanswered.

These tags, in general, are really most used to put flash movie into the web site, and as anyone can guess they are two cause of the differences in the web, specially between the web browsers. The <object> tag helps for the browser who use ActiveX controls to display properly the flash movie. In fact the newest Internet Explorer browsers like 7 version and 8 beta, display the movie correctly even without the <object> tag, but not always those flash movies work in the expected manner. Somethimes there are problems with autoplay or something like that. Especially this can be problematic when using some kind of .flv player. In that case (depending from the player) the movie initialize but the required .flv does not load and play. This was the problem I wrote for in my previous post about Opera and JW FLV Player.

As you may guess the <object> tag can handle much more the flash movie, but as many other entities as there are ActiveX controls.

To be more exact the <object> tag is for Internet Explorer, while the <embed> tag is for Netscape and related to it browsers using Netscape plugin to display a flash movie. More detailed information can be found on Adobe site:

All the specification can be found online but more important is to mention the semantics of some of the attributes.

For both of the tags valid attributes are width and height. They can be either pixels or percentage, which are relative from the element containing the object/embed pair, i.e. if the flash is in a div with fixed width of 800px and the object/embed pair is 100% width the movie will became 800px wide.

Notice: some browsers do not calculate the height correctly when the height is set in percentage.

For the <object> tag only there should be classid, codebase, movie attributes, while for the <embed> tag only is src and pluginspage.

see which attributes are mandatory and which one are not at: object and embed tags revealed

33 thoughts on “Html object & embed tags

  1. I’d like to add something about the transparency of the PNG’s using the object tags. There is no such a general solution for this even using the tag. Some browsers still continue to display the .png files without the transparency, and that remains unused afther the filter opacity patch for IE 6.

    Thank you for the article anyway. The information seemed interesting to me and maybe to many others.

  2. I agree! Almost everybody is using the object / embed pair to put some flash animations in the site. Who cares there’s other usage of the object tag?

  3. There’s the case. Everybody knows the mass usage of those tags. The key is that there’s another usage. If someone’s searching for it – it appears difficult to find some resource.

  4. that is good information for me. Because I was searching for any tag to insert media player in my website. And I have found embed tag from here for that purpose..

  5. Отличный пост, прочитав несколько статей на эту тему понял, что всё таки не посмотрел с другой стороны, а пост как-то очень заинтересовал.

  6. Огромное вам человеческое спасибо, очень актуальная заметка.

  7. Хорошо пишете. Надеюсь, когда-нибудь увижу нечто подобное и на своем блоге…

  8. Great site this and I am really pleased to see you have what I am actually looking for here and this this post is exactly what I am interested in. I shall be pleased to become a regular visitor 🙂

  9. Спасибо вам огромное:) Классная тема, пишите чаше – у вас отлично получается 🙂

  10. Интересно и позновательно, а будет еще что-то по этой теме?

  11. Хороший блог 🙂 Люблю почитывать каждый вечер (ну и в другое время тоже :)).

  12. Спасибо за статью.. Актуально мне сейчас.. Взяла себе еще перечитать.

  13. Спасибо. Просто спасибо, за красивые мысли вслух. В цитатник.

  14. Очень интересно!!! Только не очень могу понять как часто обновляется ваш блог?

  15. Благодарю!!!У Вас часто появляются очень интересные посты! Очень поднимаете мое настроение.

  16. Очень интересно. Но чего-то не хватает. Может быть, стоит добавить каких-нибудь картинок или фото?

  17. Я в принципе, мало, что смыслю в этм посте, но постараюсь все таки понять.

  18. Очень интересно, но все в будущем хотелось бы еще побольше узнать об этом. Очень понравилась ваша статья!

  19. Вот решил вам немного помочь и послал этот пост в социальные закладки. Очень надеюсь ваш рейтинг возрастет.

  20. Огромное вам пасибо! а еще посты на эту тему будут в будущем? Очень жду!

  21. This is a great post on HTML.and i agree with you that this is only the website language which is constantly using for web page designing and development of websites..
    its a very good post and you can also take guide line from the to learn more about the use of this language..

  22. why embed tag not working in mobile phone….
    my web page having video and it shows and playing in web but not displaying video in mobile phone plz help me why.

Leave a Reply

Your email address will not be published. Required fields are marked *