Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

iframed anchors in firefox - problem

iframed anchor firefox not working



9:22 pm on Feb 14, 2012 (gmt 0)


I've the newest version of the following browsers:
Google Chrome
Internet Explorer

And only firefox refuses to go directly to anchor which is located in a website loaded in iframe. The link however without iframe works. How can I solve this problem ?

<a href="page1.html#anchor1" target="iframe1">Iframed anchor link</a>


<iframe name="iframe1" id="iframe1"></iframe>



<a name="anchor1">test</a>


8:23 am on Feb 15, 2012 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

Is page1.html the document inside the iframe?


8:55 am on Feb 15, 2012 (gmt 0)

It is


9:00 am on Feb 15, 2012 (gmt 0)

I've checked today again to see if it wasn't one-time thing, and I'm afraid its not.

The anchor itself (without iframe) wasn't working without a <!DOCTYPE>, after I've had added <!DOCTYPE> it started to working but still doesn't work in iframed window.

My focus now is to consider a following:
- iframe in table might cause a problem
- different doctypes
- anchors in table might not work


5:35 pm on Feb 15, 2012 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

You could try adding an id attribute to the anchor - <a name="anchor1" id="anchor1">test</a>


5:43 pm on Feb 15, 2012 (gmt 0)

I found a problem, need solution now.

My iframe is very long and so no scrolling is required and firefox consider to transfer to an anchor only when there is scrolling-bar in iframe. It simply ignores the height =/

I'm not sure how to find solution for this problem yet.


6:14 pm on Feb 16, 2012 (gmt 0)

Hi again,

I'm struggling with trying to find a solution for the problem.
Here is a source code of the problem:

2 seperate pages:

index.html and subpage.html

subpage.html is loaded into iframe which is located in a [u]index.html[/u].

subpage.html has anchors at different heights of the website.

link to anchors are located in [u]index.html[/u].

<a href="subpage.html#anchorTop" target="iframe1"></a>
<a href="subpage.html#anchorBottom" target="iframe1"></a>

<iframe height="1600"></iframe>


<a id="anchorTop" name="anchorTop"></a>
<a id="anchorBottom" name="anchorBottom"></a>
Part at the bottom of the iframe.
Part not visible in the window but is loaded into iframe

**Remove or ADD <br> to make sure the text is not visible but the scroll bar in iframe is not showed.

Featured Threads

Hot Threads This Week

Hot Threads This Month