-
Hajipur, Bihar, 844101
<iframe>
?An iframe (Inline Frame) is used to embed another HTML page or content (like a video, map, or another website) into the current webpage.
<iframe src="url" width="width" height="height"></iframe>
Attribute | Description |
---|---|
src |
The URL of the page to display |
width |
Width of the iframe (px or %) |
height |
Height of the iframe (px or %) |
<iframe src="https://www.example.com" width="600" height="400"></iframe>
<iframe width="560" height="315"
src="https://www.youtube.com/embed/tgbNymZ7vqY"
title="YouTube video" frameborder="0"
allowfullscreen></iframe>
<iframe
src="https://www.google.com/maps/embed?pb=..."
width="600" height="450" style="border:0;"
allowfullscreen="" loading="lazy">
</iframe>
<iframe src="page.html" style="border: none;" width="500" height="300"></iframe>
Use the sandbox
attribute to apply security restrictions:
<iframe src="page.html" sandbox></iframe>
You can also use:
<iframe src="page.html" sandbox="allow-scripts allow-forms"></iframe>
<iframe name="myframe" width="500" height="300"></iframe>
<a href="page.html" target="myframe">Load Page in iframe</a>
Q1. Create an iframe that loads https://example.com
.
Q2. Embed a YouTube video using an iframe.
Q3. Display an HTML file info.html
inside an iframe.
Q4. Create an iframe with a height of 400px and width of 700px.
Q5. Remove the border from an iframe using inline CSS.
Q6. Add a link that opens content into a named iframe.
Q7. Embed a Google Map of your city using iframe code.
Q8. Use the sandbox
attribute to disable forms and scripts.
Q9. Make an iframe responsive using CSS.
Q10. Embed a PDF file using iframe in a webpage.
Q1: Which HTML tag is used to embed another page into the current page?
Q2: What attribute specifies the URL of the iframe content?
Q3: What is the default behavior if the iframe content is not found?
Q4: Which attribute is used to secure iframe content?
Q5: What does the allowfullscreen attribute do?
Q6: Which tag can you use to load a video from YouTube?
Q7: Which attribute allows an iframe to be the target of a link?
Q8: Can you use an iframe to embed a PDF?
Q9: What happens if the iframe content uses scripts and sandbox is set without allow-scripts?
Q10: What is the purpose of frameborder="0"?