Last Updated on April 26, 2023 by Roshan Parihar
HTML object tag is used to include the video, sound or other media files in the web pages.
Almost all the browsers support the object tag to show video or audio content.
Syntax
1 |
<object width="enter width" height="enter height" data="url location of the media file"></object> |
1 |
<object data="../media/peacock.wav"></object> |
Output
This is the example for object tag that contains the video file to show with controls.
1 |
<object data="../media/birdreaction.mp4"></object> |
Output
This is the example for object tag that contains the image file to show image.
1 |
<object data="../images/nature.jpg" width="100" height="100"></object> |
Output
List of HTML object tag attributes
Sr. No. | Attribute options | Description |
---|---|---|
1 | height | Used to specify the height of the object content. |
2 | width | Used to specify the width of the object content. |
3 | data | Used to specify the location of the content imported by the object. |
4 | type | Used to specify the type of the content imported by the object. |
5 | form | Used to specify the form id the object associated with. |
Resources and References
1. W3C Specification.
2. HTML living standard
3. W3C project using Github