HTML <iframe> src attribute

Definition and usage

src Attribute specifies the address of the document embedded in the iframe.

Example

The simplest usage of <iframe>:

<iframe src="/index.html"></iframe>

Try it yourself

Syntax

<iframe src="URL">

Attribute value

Value Description
URL

Specifies the URL of the document to be embedded in the iframe.

Possible values:

  • Absolute URL - points to another website (e.g., src="http://www.example.com/index.html")
  • Relative URL - points to a file within a website (e.g., src="index.html")

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support