Dofactory.com
Dofactory.com

HTML <iframe> src Attribute

The src attribute on an <iframe> tag specifies the URL or path of a source file to be embedded in the current page.

The browser uses the URL to locate and load the source file.

Example

#

A src attribute on an <iframe> element.
The attribute references a page to be placed inside the current page.

<iframe src="https://www.wikipedia.org/wiki/Vincent_van_Gogh"
        style="width:100%;height:500px;">
</iframe>

Using src

The src attribute specifies the URL or path of the page to be embedded.

The src URL can be internal (from same website) or external (another website).


Syntax

<iframe src="URL">

Values

#

Value Description
URL URL of the page to be embedded inside the iframe.

Browser support

Here is when src support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <iframe>

Author: Jack Poorte
Published: Jun 20 2021
Last Reviewed: Sep 30 2023


What's your favorite/least favorite part of Dofactory?


Guides