Forum Moderators: open

Message Too Old, No Replies

Iframe Links Broken in iframe

         

almo136

1:32 am on Sep 11, 2008 (gmt 0)

10+ Year Member



Hi,

I've an html page which has a navigation bar in it. I then call this into the top of all my other pages using an iframe. The problem is that the links within the iframe stop working in my other pages with firefox.

Any ideas what could be causing this or how to fix it?

Thanks!

almo136

1:33 am on Sep 11, 2008 (gmt 0)

10+ Year Member



forgot to mention....

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

almo136

6:21 pm on Sep 11, 2008 (gmt 0)

10+ Year Member



I think I figured out what is causing this but I don't know how to fix it.

This is the css which keeps all of the content from the main page below the navigation iframe:

#wrapper {
text-align: left;
width: 728px;
position: relative;
margin: 0px auto;
padding-top: 104px;
}

The padding is what keeps the main content further down the page so it doesn't cover the navigation iframe.

What I think is happening is that the Iframe is behind this padding and therefore the links can't be selected.

Does this make sense. If so is there a way I could fix it?

encyclo

10:26 pm on Sep 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld almo136 - can you replace the padding with margin instead? Ideally, you should not be using an iframe in this situation because the navigation is separate from the page itself, creating problems for indexation and accessibility. You might want to check out some server-side scripting solutions instead.

utopian

10:34 pm on Sep 11, 2008 (gmt 0)

10+ Year Member



Almo,

Try using absolute links in the code for the iframe, not relative.

Example of absolute link: [mysite.com...]

Example of relative link: subfolder/mypage.htm

almo136

2:31 am on Sep 12, 2008 (gmt 0)

10+ Year Member



thanks for the suggestions. I tried using margins but this messed things up in firefox.

I finally figured it out though and realised I had to use z-index to bring the iframe to the front.

I'll also check out some server-side scripting solutions as suggested for a better alternative.

thanks!