HTML5
HTML5

HTML iFrame

An <iframe> embeds another web page or document inside your page. Think of it as a small window inside your page that can show content from another location. The src attribute tells the iframe what to load. width and height control its starting size. Common uses include maps, videos, documents, and trusted external tools. Because an iframe loads outside content, security and privacy settings matter. The sandbox attribute can restrict what the embedded page is allowed to do.

Why this matters

  • ·Iframes can bring useful external content into a page.
  • ·Maps and video players are common examples.
  • ·sandbox can reduce what embedded content is allowed to do.

Common mistakes

  • ·Embedding untrusted content can create security risks.
  • ·Very large iframes can hurt mobile usability.
  • ·Do not assume every website allows itself to be embedded.
Your codeHTML
Live preview

Frequently asked questions

It embeds another document or web page inside the current page.

Practice questions

Question 1

Embed a page with a title and size.

Your codeHTML
Live preview

Question 2

Add lazy loading to an iframe.

Your codeHTML
Live preview

Quick check

Just for this topic answer honestly, then check yourself.

1 / 3

Which tag embeds another page?