HTML <iframe> src Attribute

Definition and Usage

src The attribute specifies the address of the document to be 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