HTML iframe Tag src Attribute Tutorial

In this section, we will see what src attribute is and how to use it.

What is src Attribute in HTML <iframe> Tag?

The src attribute used in HTML <iframe> element to set the external resource that we want to load in the current document.

The value of this attribute could be any relative or absolute URL.

When browsers see this address, they will send a request to it and the returned document will be loaded in the area of the target <iframe> element.

HTML src Attribute in <iframe> Tag Syntax:

<iframe src = “url-address-of-the-target-resource”> </iframe>

<iframe> Tag src Attribute Values

The value of the src attribute is any external resource that we want to load in the body of the current document.

Example: using src attribute in HTML <iframe> tag

See the Pen using src attribute in HTML <iframe> tag by Omid Dehghan (@odehghan) on CodePen.

Leave a Reply