-
Hajipur, Bihar, 844101
Hajipur, Bihar, 844101
HTML5 Basics
HTML Introduction
HTML Editors
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Quotations
HTML Comments
HTML Styling and Design
HTML Links and Media
HTML Layout and Structure
HTML Tables
HTML Lists
HTML Block & Inline
HTML Div
HTML Classes
HTML Id
HTML Head
HTML Layout
HTML Responsive
HTML Computercode
HTML Semantics
HTML Forms
HTML Forms
HTML Form Attributes
HTML Form Elements
HTML Input Types
HTML Input Attributes
Input Form Attributes
HTML Graphics
HTML APIs
HTML Advanced Topics
<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.
HTML5 Basics
HTML Introduction
HTML Editors
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Quotations
HTML Comments
HTML Styling and Design
HTML Links and Media
HTML Layout and Structure
HTML Tables
HTML Lists
HTML Block & Inline
HTML Div
HTML Classes
HTML Id
HTML Head
HTML Layout
HTML Responsive
HTML Computercode
HTML Semantics
HTML Forms
HTML Forms
HTML Form Attributes
HTML Form Elements
HTML Input Types
HTML Input Attributes
Input Form Attributes
HTML Graphics
HTML APIs
HTML Advanced Topics