The output of the above code will be a PDF document embedded within the HTML page with a fallback option in case the browser does not support PDFs.
Explanation
- The
data
attribute specifies the URL of the PDF document to be embedded.
- The
type
attribute specifies the MIME type of the embedded document.
- The
width
and height
attributes specify the size of the embedded document within the HTML page.
- If the browser does not support the embedded document, the content inside the
<object>
tag will be displayed as a fallback option.
Use
The HTML <object>
tag can be used to embed various multimedia content within an HTML document such as videos, audios, SVG images or any type of documents like MS Word, PDF, Excel and more.
Important Points
- The
<object>
tag should be used with caution when embedding external content as it may cause security and compatibility issues.
- The URL provided in the
data
attribute must be a valid and accessible URL.
Summary
The HTML <object>
tag is useful for embedding various multimedia content within an HTML document. It provides a fallback option in case the browser does not support the embedded content. However, it should be used with caution when embedding external content and the URL provided in the data
attribute must be valid and accessible.