Click to See Complete Forum and Search --> : [RESOLVED] Target iframes in Safari


magpiette
12-04-2009, 09:13 AM
Hello, when I click the links in Firefox they open up in a different iframe as they are supposed to. However, although the main iframe shows up in Safari, the new iframe does not load at all.

http://www.artic.edu/~syoo7/

Here is the iframe part:


<center>
<iframe id="index" name="index" style="position: absolute; margin-top:80px; margin-left:-450px; height:500px; width:150px; border:0px; overflow:hidden" src="00blank.html">if you can see this your browser does not support iframes</iframe>
<br>
<iframe id="main" name="main" style="height:640px; width:620px; border:0px; overflow:hidden" src="home.html"></iframe>
<p><a href="home.html" target="main">home</a></p>
</center>
</body>


I searched iframe + Safari compatibility and couldn't find a solution, hopefully this is clear enough.
Thank you for your time!

Fang
12-04-2009, 09:55 AM
margin-left: -450px; Off screen?

magpiette
12-04-2009, 10:16 AM
wow that was silly, I didn't even think of that, thank you.
However, it was the only way I could get the second iframe placed where I wanted in Firefox, since I had centered both iframes. In Safari the placement is completely different with the same margin-left, is there a way I can fix that part?

Fang
12-04-2009, 10:43 AM
This will keep the iframes 'locked' together:body {
margin-top:5px;
font-family: "courier";
font-size: 12px;
width:620px;
margin:auto;
position:relative;
}
#index {overflow: hidden; position: absolute; top:80px; left:-150px; height: 500px; width: 150px;}
#main {overflow: hidden; height: 640px; width: 620px;}
p {text-align:center;}

a:link {color:#000000;text-decoration:none;}
a:visited {color:#000000;text-decoration:none;}
a:active {color:#000000;text-decoration:none;}
a:hover {color:#FFFFFF;text-decoration:none; background-color:#000000;}
<iframe id="index" name="index" src="00blank.htm">if you can see this your browser does not support iframes</iframe>
<iframe id="main" name="main" src="home.htm"></iframe>
<p><a href="home.html" target="main">home</a></p>

magpiette
12-04-2009, 04:39 PM
That works perfectly, thank you!