Your online searching blog. Find Blogging tricks and many more

Friday, 13 January 2012

how to embed a page in frame


Have you ever wondered if you can embed website contents from one website to another? It’s doable and perfectly simple. But is it legal or not? I dunno about the legality of which, but if you own both sites then for sure it’s permissible I think. I have posted before about My Little Forum a Basic Web Forum. I have used MLF and embedded it as part of the Gender Development Studies  (GDS) site.

How does one do this? There’s no need long list of code, or complex JavaScript coding, but it uses pure simple HTML tags. The trick is to use Inline Frame or what we call IFRAME to embed an HTML document with the main document.

I have a sample code below as used in my website project:


<iframe height="50" width="100%" frameBorder="0" src="http://www.techxplore.net/index.php">your browser does not support IFRAMEs</iframe>

A short explanation:

height – sets the height of the inline frame in pixels
width – sets the width in this case 100% represent that it will use the full width available
frameborder – specifies if a border is shown or not for the frame
src – specifies the source HTML page to be embeded in the main document

The text between the opening <iframe> tag and closing </iframe> tag is the text message that will be shown whenever the client browser does not support IFRAME.

See it working in the Gender Development Studies Forum . There’s no magic in it and it’s very practical to use at times. If you are looking for a simple and solution to embedding website contents from another website then IFRAME tag could be the answer. This is HTML tag based solution so it works for all major Internet Browser such as FireFox, Internet Explorer, Opera, Safari, Google Chrome, and more. Well you can try it too.

0 comments:

Post a Comment