HTML <iframe> src Attribute

Definition and Usage

src Attributes define the address of the document embedded in the iframe.

Example

The simplest use 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 - Point to another website (such as src="http://www.example.com/index.html")
  • Relative URL - Point to a file within a website (such as src="index.html")

Browser Support

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