views:

168

answers:

3

i am trying to display a webpage within a webpage as you can see over here

http://www.yoursdproperty.com/index.php?option=com_jumi&fileid=8&Itemid=34

the top and left part is my site, and the stuff that is the main content in the middle is a different site. i may not be doing it correctly since it is not displaying it at size that fits.

the main content page is: http://www.mlsfinder.com/ca_sandicor/raphaelshapiro/index.cfm

+1  A: 

You are doing it correctly, the page won't fit as it's a fixed width of 800 pixels, it will not squeeze down to fit in your page. So only option for you is to stretch your content area to 800 pixels.

Tatu Ulmanen
And the height?
Andy E
how do i make it fit without stretching?
I__
Well, either change the embedded site to fit the 800 pixels, or enlarge the iframe.
Pekka
how do i change the embedded site? i did enlarge the iframe but it didnt do anything
I__
+1  A: 

Remove the width and height properties of the iframe tag. Adjust the width style property in the style property so that it is the correct size for the page. It appears that you need to make the iframe wider.

<iframe src="..." frameborder="0" style="width:800px;height:480px;" />

Another option, of course, would be to remove the 'scrolling="no"' from the iframe tag to allow users to use the scrollbar to see the entire inner page.

Aaron
+2  A: 

You will struggle to make this work perfectly for the following reasons:

  • You're trying to fit an 800px wide web page into a 700px wide div.
  • You cannot access the child frame's DOM to manipulate it because it's on a different domain.
  • You cannot rely on a consistent height for the child frame. Although it has a fixed width, users with different accessibility settings (such as default font sizes) could cause text to wrap and adjust the height of the document.

Although you can overcompensate for point 3 by increasing the height of the iframe to allow for any extra height, you can't really deal with point 1 without changing the layout (mainly the width) of your site.

If I were you, I would look into other avenues of adding the functionality you're looking for. Maybe by contacting the site owner and seeing if they can accomodate your needs.

Andy E