小案例:
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns= http://www.w3.org/1999/xhtml xml:lang= en head meta http-equiv= Content-Type content= text/html;charset=UTF-8 title 萌寵集結(jié)號 /title /head body li a href= #miao 去找喵星人 /a /li li a href= #wang 去找汪星人 /a /li li a href= #meng 其他萌物 /a /li /ul a name= miao /a !--設(shè)置錨點(diǎn)方法1-- h3 id= miao 喵星人基地 /h3 !--設(shè)置錨點(diǎn)方法2-- p 喵喵喵~ /p p 喵喵喵~ /p p 喵喵喵~ /p p 喵喵喵~ /p p 喵喵喵~ /p p 喵喵喵~ /p a name= wang /a p 汪汪汪~ /p p 汪汪汪~ /p p 汪汪汪~ /p p 汪汪汪~ /p p 汪汪汪~ /p p 汪汪汪~ /p a name= meng /a p 萌萌萌~ /p p 萌萌萌~ /p p 萌萌萌~ /p p 萌萌萌~ /p p 萌萌萌~ /p p 萌萌萌~ /p /body /html
二、跨頁面跳轉(zhuǎn)
①:設(shè)置錨點(diǎn)鏈接,在href中的路徑后面追加:#+錨點(diǎn)名,即可
如: a href= 萌寵集結(jié)號.html#miao 跳轉(zhuǎn)到萌寵集結(jié)號頁面 /a
②:要跳轉(zhuǎn)到的頁面中要設(shè)置錨點(diǎn),方法見一種的步驟②,兩個方法任選其一。
以上就是html中的錨點(diǎn)和頁面跳轉(zhuǎn)的詳細(xì)內(nèi)容,html教程
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。
新聞熱點(diǎn)
疑難解答
圖片精選