IFRAME
Zahid Javed
WHAT IS IFRAME
Iframe stands for Inline Frame. The ” iframe ” tag
defines a rectangular region within the document in
which the browser can display a separate document,
including scrollbars and borders. An inline frame is
used to embed another document within the current
HTML document.
The ‘ src ‘ attribute is used to specify the URL of the
document that occupies the inline frame.
WHAT IS IFRAME
An iframe or inline frame is used to display external
objects including other web pages within a web page.
The basic syntax for adding an iframe can be given
with:
WHAT IS IFRAME
IFRAME EXAMPLE
Link
REMOVING THE BORDER IN IFRAME :
By default, iframe has a border around it. To remove
the border, we must use the style attribute and use the
CSS border property.
EXAMPLE ONLINE PAGE
Link
WHERE USE IFRAMES
Iframes are used for several different purposes, such
as online advertising and multimedia. Many ad
platforms use iframes to display ads on webpages
since they provide more flexibility than an inline
script. Since iframes may contain an entire webpage,
advertisers can include extra tracking code within an
iframe that helps ensure accurate reporting for both
the advertiser and publisher.
WHERE USE IFRAMES
Iframes are also used for displaying different types of
media within a webpage. For example, YouTube
videos and Google Maps windows are often embedded
in webpages using iframes. Many web applications
use iframes since they can display dynamic content
without reloading the webpage.
https://techterms.com/category/internet
EXAMPLE
<!DOCTYPE html>
<html lang="en">
<body>
<iframe src="RadioButton.html"
name="myFrame" width=400
height=400></iframe>
<p><a href="https://www.tutorialrepublic.com"
target="myFrame">Tutorial Republic</a></p>
</body>
</html>
Link
SCR
This attribute is used to give the file name that should be loaded in the
frame. Its value can be any URL. For example, src =
"/html/top_frame.htm" will load an HTML file available in html
directory.
FRAMEBORDER
MARGINHEIGHT
This attribute allows you to specify the height of the space between
the top and bottom of the frame's borders and its contents. The value
is given in pixels. For example marginheight = "10".
MARGINWIDTH
This attribute allows you to specify the width of the
space between the left and right of the frame's borders
and the frame's content. The value is given in pixels. For
example marginwidth = "10".
MARGINWIDTH
CODE
ATTRIBUTE VALUES
CODE
SCR AND SCRDOC
VIEW PAGE
CODE
DIFFERENCE BETWEEN FRAME AND IFRAME