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:

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_4150

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


Related posts:

  1. object and embed tags revealed
  2. object and embed tag position in IE
  3. OBJECT & … forget about EMBED tag!
  4. IE & ExternalInterface communication problem
  5. IE 6 problem with flash z-index

You are a GREAT developer? Click here to answer the weekly quiz!

This entry was posted in featured, web development and tagged , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

33 Responses to Html object & embed tags

  1. b. johnson says:

    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. green wave says:

    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. stoimen says:

    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. hatezie says:

    I don’t care about IE 6, that’s not a browser by myself!

  5. harish says:

    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..

  6. stoimen says:

    I’m glad I’ve helped you.

  7. n. deverges says:

    très bien. merci

  8. mewerroG says:

    Автор выйди к напроду, вопросы есть!

  9. Mawalletenon says:

    Извините если не туда, но как с админом сайта связаться?

  10. stoimen says:

    Just write a mail on popov at stoimen.com

  11. InonPecy says:

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

  12. Inepoche says:

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

  13. Aginna says:

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

  14. Incickjichege says:

    Great site this http://www.stoimen.com 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 :)

  15. Бaкинcкийпapeнь says:

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

  16. Liathort says:

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

  17. goaste says:

    Спасибо за статью. Восхищена как всегда

  18. мышкин says:

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

  19. Usagor says:

    очень занимательно было почитать

  20. Pakecope says:

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

  21. BoBinjegofef says:

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

  22. AlielePalo says:

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

  23. Bobin says:

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

  24. Floodsdayday says:

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

  25. parMatincatt says:

    Скажите, а у вас есть RSS поток в этом блоге?

  26. Druptubper says:

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

  27. Pourneerop says:

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

  28. Indish says:

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

  29. Memabs says:

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

  30. 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 http://www.w3school.com to learn more about the use of this language..

  31. Deril says:

    Cognitive. I would like to hear more expert opinion on the subject

  32. vamshi says:

    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 *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>