<script src="https://lf6-cdn-tos.bytescm.com/obj/cdn-static-resource/tt_player/tt.player.js?v=20160723"></script>
a鏈接可以調(diào)用JavaScript腳本文件
<a href="javascript:alert('你點(diǎn)我干啥啊')"></a>
<script src="https://lf3-cdn-tos.bytescm.com/obj/cdn-static-resource/tt_player/tt.player.js?v=20160723"></script>
一、超鏈接不同時(shí)期的樣式
1、默認(rèn)情況下:字體為藍(lán)色,帶有下劃線。
2、鼠標(biāo)點(diǎn)擊時(shí):字體為紅色,帶有下劃線。
3、鼠標(biāo)點(diǎn)擊后:字體為紫色,帶有下劃線。
二、超鏈接偽類
用偽類定義鼠標(biāo)點(diǎn)擊的不同時(shí)期樣式。
語法(必須按照順序定義);
a:link{…} // 定義a元素未訪問時(shí)的樣式
a:visited{…} // 定義a元素訪問后的樣式
a:hover{…} // 定義鼠標(biāo)經(jīng)過a元素時(shí)的樣式
a:active{…} //定義鼠標(biāo)點(diǎn)擊激活時(shí)的樣式
舉例:
<script src="https://lf6-cdn-tos.bytescm.com/obj/cdn-static-resource/tt_player/tt.player.js?v=20160723"></script>
一、超鏈接作用:
網(wǎng)頁間或本地文件間相互跳轉(zhuǎn)
二、超鏈接標(biāo)簽:a
網(wǎng)頁跳轉(zhuǎn)示例:
<a href="https://www.baidu.com/">百度網(wǎng)站</a>
本地跳轉(zhuǎn)示例
<a href="second.html">跳轉(zhuǎn)到第二個(gè)網(wǎng)站</a>
效果:
點(diǎn)擊百度網(wǎng)站后,會(huì)跳轉(zhuǎn)到百度網(wǎng)站
href屬性:可以是跳轉(zhuǎn)的網(wǎng)頁或者本地文件的位置
target屬性:
1、_self 默認(rèn)值,在原來窗口打開鏈接
2、_blank 在新窗口打開鏈接(常用)
3、_parent 在父窗口打開鏈接
4、_top 在頂層窗口打開鏈接
示例:
<a href="https://www.baidu.com/" target="_blank">百度網(wǎng)站</a>
三、錨點(diǎn)鏈接
有些頁面內(nèi)容比較多,導(dǎo)致頁面過長,此時(shí)用戶需要不停拖動(dòng)瀏覽器上的滾動(dòng)條才可以看到下面的內(nèi)容。為了方便用戶操作,我們可以使用錨點(diǎn)鏈接來優(yōu)化用戶體驗(yàn)。
*請(qǐng)認(rèn)真填寫需求信息,我們會(huì)在24小時(shí)內(nèi)與您取得聯(lián)系。