Jump to content

Iframes


halvorsen
 Share

Recommended Posts

I have two adjacent iframes (iframe1 and iframe2) on my main page. Iframe1 references an image from file1, and iframe2 references an image from file2. The image in file 1 is the left portion of a picture while the image in file2 is the right portion of the same picture. When displayed, I want the picture to appear as one complete picture. Unfortunately, there is a small space between the two halves of the image when I view it in a browser. I've tried setting borders, frameborders, margins, framespacing, etc to zero, but nothing seems to help. Any ideas what might be wrong? Below is the coding for iframe1:<iframe src="subnavigation.htm" name="subnavigation" width="150" height="339" framespacing="0" hspace="0" vspace="0" frameborder="0" border="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>Your guidance would be much appreciated. Thanks.

Link to comment
Share on other sites

<table cellpadding="0" cellspacing="0" border="0"><tr><td valign="top"><iframe src="frame2.htm" name="subnavigation" width="150" height="339" framespacing="0" hspace="0" vspace="0" frameborder="0" border="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scrolling="no" /><br /></td><td valign="top"><iframe src="frame2.htm" name="subnavigation" width="150" height="339" framespacing="0" hspace="0" vspace="0" frameborder="0" border="0" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scrolling="no" /><br /></td></tr></table>

Link to comment
Share on other sites

Skemcin's code seems to have solved the problem with the gap between the adjacent iframes, but now I can't seem to add anything above or below the iframes. When I do, the iframe coding generates a line break (which the br tag is supposed to do, I guess). Any ideas out there? The current code looks like this:

<table width="800" cellpadding="0" cellspacing="0" border="0">    <tr>       <td valign="top"> <iframe src="subnavigation.htm" name="subnavigation" width="150" height="339" framespacing="0" frameborder="0" scrolling="no" /><br />      </td>      <td valign="top"> <iframe src="content.htm" name="content" width="550" height="339" framespacing="0" frameborder="0" scrolling="no" /><br />      </td>    </tr></table>

Link to comment
Share on other sites

Try this:

<table width="800" cellpadding="0" cellspacing="0" border="0"><tr><td valign="top">Content above the subnavigation iframe<br /><br /><iframe src="subnavigation.htm" name="subnavigation" width="150" height="339" framespacing="0" frameborder="0" scrolling="no" /><br /><br />Content below the subnavigation iframe<br /></td><td valign="top">Content above the content iframe<br /><br /><iframe src="content.htm" name="content" width="550" height="339" framespacing="0" frameborder="0" scrolling="no" /><br /><br />Content below the content iframe<br /></td></tr></table>

However, if your content on top of either side is longer than the other, then your <iframes> will not start at teh same point. to get around this, just add a row at the top with two columns and/or a row at the bottom.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...