HTML <iframe> srcAttributes

HTML iframe 标签参考手册HTML <iframe> Tag

Example

A simple example of an <iframe>:

<iframe src="http://www.w3cschool.cc/"></iframe>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the src attribute.


Definition and Usage

The src attribute specifies the address of the document to be embedded in the <iframe>.


Differences between HTML 4.01 and HTML5

None.


Syntax

<iframe src="URL.html">

Attribute Value

Value Description
URL Specifies the address of the document displayed in the iframe.

Possible values:

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


HTML iframe 标签参考手册HTML <iframe> Tag Other Extensions