HTML Chapter 5 IFrame
HTML Chapter 5 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
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