iFrame in HTML

An <iframe> (Inline Frame) is used to embed another webpage, video, or content inside the current HTML document. Unlike <frameset>, which is deprecated, <iframe> is still widely used in modern web development.

Basic Example of <iframe>

<iframe src="https://www.example.com" width="600" height="400"></iframe>

Common Attributes of <iframe>

AttributeDescriptionExample
srcURL of the embedded page<iframe src="page.html">
widthWidth of the iframe (in px or %)<iframe width="800">
heightHeight of the iframe<iframe height="500">
frameborderAdds/removes border (0 = No, 1 = Yes)<iframe frameborder="0">
allowfullscreenEnables fullscreen mode<iframe allowfullscreen>
nameAssigns a name to the iframe<iframe name="myFrame">

Embedding YouTube Videos 

<iframe width="560" height="315" 
        src="https://www.youtube.com/embed/dQw4w9WgXcQ" 
        frameborder="0" 
        allowfullscreen>
</iframe>

Programs

html code to develop a web page having two frames that divide the page into two equal rows and divide the first row into equal columns

View Solution


HTML page to demonstrate target attribute in Frames

View Solution


Create a webpage divide the webpage into six frames In one frame create five links that will display different HTML forms in the remaining five frames respectively

View Solution


Create a page with two frames using HTML

View Solution


Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad