<base target="_blank">
会让该页面内的所有链接都在新窗口下打开,而我只希望部分链接在新窗口打开,而且是在纯CSS下完成。
因此
纯CSS下如何让指定DIV( class="example)内的链接在新窗口打开,而非该DIV(class="other")内的链接依然在原窗口打开呢?
以下这段代码无效啊。
<style>
.example a:active {test:expression(target="_blank");}
</style>
<div class="example">
<a href="http://www.w3school.com.cn/">新窗口打开</a>
</div>
<div class="other">
<a href="http://www.w3school.com.cn/">原窗口打开</a>
</div>
你可以把你不想跳转到新页面的链接里的target属性值改成_self试试
target="_blank" 为新页面打开
target="_self" 为当前页面打开