单击外部链接后链接到页面的特定位置

问题描述:

我想知道在外部链接中单击后是否可以移动到页面的特定位置。单击外部链接后链接到页面的特定位置

假设我有一个链接:<a href="another_page.html">Go there</a>。当我点击'Go there'后,我想要移动到another_page.html的特定位置。职位可能在buttom或中心或任何其他职位。可能吗。

你可以去到页面的任何位置,通过参考元素ID一样,

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

another_page.html页面上创建id="position"一个div

<div id="position"> 

它将点position div

您可以使用HTML's anchors

主页:

<a href="test1.html#John">John</a> 
<a href="test1.html#Doe">Doe</a> 

示例页面:

<div id='John'></div> 
<div id='Doe'></div> 

您可以使用链接的ID作为参考实现这个!

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

Sample Link

您可以使用一个href以 '#' 与特定的ID链接的元素:

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

凡another_page.html与

元素

<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