Reputation: 61
i have this iFrame -
<iframe src="http://mp3yoyo.com/ads.php" scrolling="no" width="500" height="80" frameborder="0"></iframe>
but when i click on link of any ads then it open in same window.
I want to open all links of iFrame in new window.
I have already try by adding target="_blank"
and <base target="_blank" />
but i am not opening link in new window so please help me.
Upvotes: 2
Views: 8014
Reputation: 63424
This might help: http://www.webhostingtalk.com/showthread.php?t=678138
In general, you should be telling the links to open in new windows (in the anchor tag). You can control the action of the anchor tag in css, but I don't think iFrames support css like divs do (as iFrame isn't really part of CSS 3 to my knowledge).
If you use div instead of iFrame, according to CSS 3.0, you can give the div a class or an id and then control the anchor tag in the css, like so:
<div id="myDiv>
<a href="whatever.html">stuff</a>
</div>
and then in your CSS file:
#myDiv a{
target-name:new;
target-new:tab;
}
I don't think this is actually supported yet, however; so this is largely theoretical.
Upvotes: 3