What is Iframe?

Frame / IFrame

IFrame Definition

Inline Frame or IFrame is an HTML function for displaying two or more webpages in a single window on a website. Iframes can be embedded anywhere within a website layout. The iframe is a window frame with a content, image or text file from any other site. This function is used to organize navigation. The iframe is put into an HTML document with the help of iframe tag. It can serve as a link target, be printed and contain viewable source code.

The iframe is applied to embed content from another source. It fixes a rectangular area within the document. The illustration above would insert the content from the URL into 560 x 315 px iframe within the webpage. The IFrame source (scr) is called from the external page on the same server. In this example, the script can load YouTube video player. The width and height attributes define the size of the iframe here.

One of the main purposes of using iframes is online promotion and multimedia. Iframes offer more flexibility to display ads on webpages. Web apps use iframes to display dynamic content without refreshing the webpage. This function helps centralize navigation. The iframe content can load in parallel and the navigation remains unchanged. It behaves like an inline image and can be configured with its own scrollbar. In fact, over 90% of display ads are served within iframes function.

To keep things simple, iframe function allows you to break up content, display the second content within your main site, and better manage to load. The flexibility of iframes allows use it for many purposes. In addition, iframe function allows control external links in the parent page. The iframe element is supported by all modern browsers.

Iframe element includes the global attribute such as align, allowfullscreen, frameborder, height, longdesc, marginheight, marginwidth, name, scrolling, scr, noresize, sandbox, remote, referrpolicy, etc.

IFrame Best Practices:

  • enbedding the third party media
  • embedding your own media
  • embedding code examples
  • embedding the third-partt 'applets' such as payment forms.

Basic IFrame Commands:

  • FRAMESET starts any frame page
  • COLS means columns
  • FRAME SCR denotes the source of the frame
  • /FRAMESET ends the whole deal.

Related terms: navigation, embedded, HTML, element

References and further reading: