2014-10-07 86 views
1

我想知道在外部鏈接中單擊後是否可以移動到頁面的特定位置。單擊外部鏈接後鏈接到頁面的特定位置

假設我有一個鏈接:<a href="another_page.html">Go there</a>。當我點擊'Go there'後,我想要移動到another_page.html的特定位置。職位可能在buttom或中心或任何其他職位。可能嗎。

回答

1

你可以去到頁面的任何位置,通過參考元素ID一樣,

<a href="another_page.html#position">Go there</a> 

another_page.html頁面上創建id="position"一個div

<div id="position"> 

它將點position div

0

您可以使用鏈接的ID作爲參考實現這個!

說:<a href="another_page.html#mylink">Go there</a>another_page.html頁面,創建提到id(例如:<p id="mylink">Mylink<p>

Sample Link

1

您可以使用一個href以 '#' 與特定的ID鏈接的元素:

<a href="another_page.html#gothere">Go There</a> 

凡another_page.html與

元素
0
<a href="#section">Section part></a> 
When click on the anchor then it will be redirect on this section which is mentioned below. 

<div id="section"> 
Hi I am websolutionexpert 
You can follow me. 
</div> 
+0

這只是內部鏈接。問題不在於此。 – user254153 2014-10-07 07:49:00