Hyperlink implementation bookmark
To implement bookmarks, you need to understand what an anchor is. An anchor is an anchor attached to a ship. After the anchor is dropped, the ship will not easily drift away or get lost. In fact, anchors are used to jump to different locations within a single page. Some places are called bookmarks. The tag involved is of course the < a> tag. The name attribute of the hyperlink tag is used to define the name of the anchor. One page can define multiple anchors, and the href attribute of the hyperlink can be used to jump to the corresponding anchor based on the name. Implement the jump as follows:
<a href="#跳轉(zhuǎn)目的地名稱">跳轉(zhuǎn)起始字符</a> ... ... ... <a name="跳轉(zhuǎn)目的地名稱">跳轉(zhuǎn)目的地字符</a>
Let’s implement the specific implementation below:
<html> <head> <title>HTML</title> </head> <body style="font-size:20px"> <p style="text-align:center">網(wǎng)頁書簽</p> <p> <a href="#c1">網(wǎng)頁一</a> </p> <p> <a href="#c2">網(wǎng)頁二</a> </p> <p> <a href="#c3">網(wǎng)頁三</a> </p> <p> <a href="#c4">網(wǎng)頁四</a> </p> <p> <a href="#c5">網(wǎng)頁五</a> </p> <h1><a name="c1"></a>網(wǎng)頁鏈接一</h1> <p>內(nèi)容</p> <p>lalalaalalal</p> <p>lalalaalalal</p> <h1><a name="c2"></a>網(wǎng)頁鏈接二</h1> <p>lalalaalalal</p> <p>內(nèi)容</p> <p>lalalaalalal</p> <h1><a name="c3"></a>網(wǎng)頁鏈接三</h1> <p>內(nèi)容</p> <p>lalalaalalal</p> <p>lalalaalalal</p> <h1><a name="c4"></a>網(wǎng)頁鏈接四</h1> <p>內(nèi)容</p> <p>lalalaalalal</p> <p>lalalaalalal</p> <h1><a name="c5"></a>c網(wǎng)頁鏈接五</h1> <p>lalalaalalal</p> <p>lalalaalalal</p> <p>內(nèi)容</p> </body> </html>
Click to implement the jump