Jean-Luc Nacif Coelho Jean-Luc Nacif Coelho - 23 days ago 9
HTML Question

Links in embedded html

I have some HTML code I'm trying to embed into a site.
The code is an iframe that is supposed to have a bunch of links in it, but when I click the links, they just load the page inside the iframe block.

before click
after click

Here is the code:


<head height="200" width="300">
<iframe height="200" width="300" src="test.html"></iframe>


<a href="file:///Users/Jean/base.html">Link</a>

Is there a way for me to tell the link NOT to load inside the frame?

I already know of a workaround which is to add "target="_blank"" to the link so it opens in a new tab.

Answer Source

Try adding the target attribute as shown below

<a href="file:///Users/Jean/base.html" target="_parent">Link</a>

the tag _parent will target the iframe's immediate parent window. the tag _top will target the top window.