How to Add Iframe in HTML

preview_player
Показать описание
Follow this step by step easy tutorial to learn how we can add iframe in html and how target frames can be implemented.

The iframe element is commonly used in web pages to insert content from another source, such as an advertisement. So in this tutorial we will learn how to add iframe in html5.

Step # 1 -- iframe Basic Code

The syntax for including an iframe in html5 is shown in the image below.

Here, the src provides the source of the document.

The width and height can be defined by the designer in px (pixels) or in percentages for example 75%.

Step # 2 -- Frame Border

Additionally we can use the frameborder property to display borders around the content.

Step # 3 -- iframe as Target Frame

An iframe can also be used as a target frame for a link.

We have to specify the name of the iframe in target attribute as a link to which we want to refer the iframe.

The image below shows the implementation of target frame.
Рекомендации по теме
Комментарии
Автор

doesnt work in my code for some reason :/


<iframe name="frame1" width="250px" height="250px"></iframe>
<p>
</p>

its exactly the same isnt it ? 

ajones