English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

HTML: <iframe> src Attribute

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

 HTML <iframe> tag

Online Example

A simple use of <iframe>:

<!DOCTYPE html>
<html>
<head>
<title>HTML: <iframe> src Attribute - Basic Tutorial Website oldtoolbag.com</title>
<body>
<iframe src="/">
  <p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

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>.

HTML 4.01 With HTML5Differences

None.

Syntax

<iframe src="URL">

Attribute value

ValueDescription
URLSpecifies the URL of the document to be embedded in the iframe.
Possible values:
Absolute URL  - Points to another website (such as SRC =“http://www.example.com/default.htm”)
Relative URL  - Points to a file within a website (such as SRC =“default.htm”)
 HTML <iframe> tag