HTML embed
Created By: chatGPT
To embed content in an HTML document, you can use several HTML elements, such as
<iframe>
, <embed>
, and <object>
. Each of these serves slightly different purposes. Below are some examples showing how to embed various types of content.<html>
<head>
<title>Embedding Content</title>
</head>
<body>
<h1>Embed Examples</h1>
<h2>Embed a YouTube Video</h2>
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/dQw4w9WgXcQ"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;"
allowfullscreen>
</iframe>
<h2>Embed a PDF Document</h2>
<embed
src="path/to/document.pdf"
type="application/pdf"
width="600"
height="400"
/>
<h2>Embed a Google Map</h2>
<iframe
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3151.835434509907!2d144.95373631561697!3d-37.81720997975195!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6ad642af0f1d61c1%3A0x5045675218cee9e!2sMelbourne%20CBD%2C%20Victoria!5e0!3m2!1sen!2sau!4v1629999986354!5m2!1sen!2sau"
width="600"
height="450"
style="border:0;"
allowfullscreen=""
loading="lazy">
</iframe>
</body>
</html>