How to Get a Remote Webpage to Display in Current Web
You can embed a web page on your website either by using frames or an iframe. Frames use a frameset that holds two or more elements (frames), each containing a separate document. A frameset document uses a different markup than standard HTML (hypertext markup language) documents, using a <frameset> tag instead of the <body> tag. Using an <iframe> HTML tag is less complicated and uses the standard HTML format. Though both formats set up differently, each offer optional elements that allow you to control how the embedded web page looks on your site.
Instructions
-
Using an <iframe>
-
1
Open your HTML page where the embedded page will display.
-
2
Write your opening and closing tag for your iframe after the beginning <body> tag: <iframe> </iframe>. Set all attributes for the embedded page in the opening iframe tag.
-
-
3
Add the source (src) URL. Src means the "source" or location of the URL page you want to embed in your iframe.
-
4
Set the width for the embedded page. The goal is to prevent scrolling from left to right. Use percent or pixels to set the width.
-
5
Set the height of the iframe using pixels. You do not need to type the word pixels or px in the string.
-
6
Set the scrollbar to display.
-
7
Remove the frameborder display: frameborder=0 removes the unappealing box.
-
8
Test the script online, replacing URL with the web page location.
<iframe src="URL" width="100%" height="600" scrolling=1 frameborder=0 >
</iframe>
Using Frames
-
9
Place the opening and closing tags for your frameset: <frameset> </frameset>. All frame elements will appear between the frameset tags.
-
10
Set the columns (col) and rows used in your frameset. When setting the frameset to one column (or row), use * for default settings; for two or more columns (or rows), separate the entries by a comma.
-
11
Add at least two frames including the src location, closing the frames by using a "/>": <frame src="page.htm" />.
-
12
For a two-column, one-row frameset, where the first frame is 20 percent of the page width, your script will look like:
<html>
<frameset cols="20%,*" frameborder=0 framespacing=0>
<frame src="frameA.htm" />
<frame src="frameB.htm" />
</frameset>
</html> -
13
For a one-column, two-row frameset, where the first frame is 80 rows high, your script will look like:
<html>
<frameset cols="*" rows="80,*" frameborder=0 framespacing=0>
<frame src="frameA.htm" />
<frame src="frameC.htm" />
</frameset>
</html>
-
1
Tips & Warnings
Elements of an iframe, such as frameborder and scrolling, display by default unless specified, .
The iframe tag does not support any event attributes.
To display an attribute, set it to "1"; to remove, set to "0" (such as framespacing=0 or frameborder=0).
The frameset tag does support several event attributes.
To handle browsers not compatible with frames or iframes, post this message within the opening and closing tags. For example, <iframe src="URL"> <p>Your browser does not support iframes.</p> </iframe>.
There is no difference when using the iframe or frameset tags in either HTML or XHTML pages.
All major browsers support the iframe tag and frameset tag.
Use of quotes is optional.
Make sure your script is using the correct quote marks (").