1._blank <a href="document.html" target="_blank">my document</a> 浏览器会另开一个新窗口显示document.html文档
2._parent <a href="document.html" target="_parent">my document</a> 指向父frameset文档
3._self <a href="document.html" target="_self">my document</a> 把文档调入当前页框
4._top <a href="document.html" target="_top">my document</a> 去掉所有页框并用document.html取代frameset文档
小技巧1:使别人的页框不能引用你的网页 在文件头加:<base target="_top">
小技巧2:在当前页打开连接或做刷新,提交到当前页在文件头加:<base target="_self">
众所周知,href的target有四个属性,分别是:_blank,_self,_parent,_top,这四个各自代表的意思也不多说了,网上一搜一大片,这里想说的是,通过给target属性一个特定的名字,有时会有不错的效果,比如下面的一段代码
HTML代码
<a href="http://www.yahoo.com.cn" target="my_tar">yahoo</a>
<a href="http://www.google.com" target="my_tar">google</a>
<a href="http://www.sina.com.cn" target="my_tar">sina</a>
<a href="http://www.blueidea.com" target="my_tar">blueidea</a>
给target属性命名为my_tar,当点击链接的时候,如果没有名为my_tar的窗口,则新建一个,否则就在已经存在的名为my_tar的窗口中打开链接,一个比较好的应用就是音乐站,如果没有给target命名,而是在多个窗口打开试听音乐的话,那效果就...
2._parent <a href="document.html" target="_parent">my document</a> 指向父frameset文档
3._self <a href="document.html" target="_self">my document</a> 把文档调入当前页框
4._top <a href="document.html" target="_top">my document</a> 去掉所有页框并用document.html取代frameset文档
小技巧1:使别人的页框不能引用你的网页 在文件头加:<base target="_top">
小技巧2:在当前页打开连接或做刷新,提交到当前页在文件头加:<base target="_self">
众所周知,href的target有四个属性,分别是:_blank,_self,_parent,_top,这四个各自代表的意思也不多说了,网上一搜一大片,这里想说的是,通过给target属性一个特定的名字,有时会有不错的效果,比如下面的一段代码
HTML代码
<a href="http://www.yahoo.com.cn" target="my_tar">yahoo</a>
<a href="http://www.google.com" target="my_tar">google</a>
<a href="http://www.sina.com.cn" target="my_tar">sina</a>
<a href="http://www.blueidea.com" target="my_tar">blueidea</a>
给target属性命名为my_tar,当点击链接的时候,如果没有名为my_tar的窗口,则新建一个,否则就在已经存在的名为my_tar的窗口中打开链接,一个比较好的应用就是音乐站,如果没有给target命名,而是在多个窗口打开试听音乐的话,那效果就...