Tutorials

KodeKite Tools

HTML
Flexbox
SVG
Canvas
HTML Tutorial

More


HTML Iframe
Iframe

Iframe can be defined in HTML tag The by using <iframe> tag and it can appear anywhere in your document. The <iframe> tag defines a rectangular region within the document in which the browser can display a separate document, including scrollbars and borders. iframe stands for inline frame and have src attribute which is used to specify the URL of the document that occupies the inline frame.

Syntax

<iframe src=URL>Content</iframe>


You can apply iframe element to any element and use any where within a HTML document.


Example


If your browser does not support <iframe> element then the message inside <iframe> element will be displayed. Iframe is a pair tag and output of iframe element is rectangular frame like you can see in above example.


Practice Task

Open notepad or any other text editor, follow the following points.


  • Select any html document or image
  • Use <iframe> element to display document or image in frame
  • width and height of iframe should be 150 150 respectively

save file with name task.html or task.htm and then open it using any browser and see results.


Solution


Don't forget iframe is non empty element which means it always comes in pair.