Continuous Test Orchestration And Execution Platform Online

Perform automated and live-interactive testing on 3000+ real desktop and mobile devices online.

What is an iframe?

An iFrame (inline frame) is an HTML element that lets you render a third-party HTML page from your HTML document. iFrames are frequently used for adding external advertisements, YouTube videos, tags, external photographs, a map to your "Contact Us" page, or any other action that enhances and engages viewers with your content.

To include an iframe in your current document, the <iframe> tag is used with commonly used attributes like src, title, width, height, etc.

The syntax for using iframe is as follows:

<iframe src="" title="Iframe Example" width="100%" height="700" style="border: 1px solid black"></iframe>

The most common use case of iframe is embedding YouTube videos on the website. It can be done as follows:

<!DOCTYPE html>
<html lang="en">
    <title>Iframe Example</title>
      title="YouTube video player"
      allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"



iFrames deals with content from a third party over which you have no control. Thus increasing the risk of having a potential vulnerability in your application or simply having to deal with a bad user experience (like annoying video autoplay). These issues can be tackled by blocking or allowing specific features with attributes like sandbox (Enables an extra set of restrictions for the content) and allow (Specifies a feature policy).

Also read: How To Handle Frames & iFrames in Selenium JavaScript.


Test your websites, web-apps, or mobile apps seamlessly with LambdaTest.

Start Free Testing

Earn resume-worthy Selenium certifications that help you land a top job.

Learn More

Test your web or mobile apps

Test orchestration and execution cloud of 3000+ browsers and OS


24/7 support


Enterprise grade security


Fastest test execution cloud