我试图将一些文本与href标签链接到我网站的特定部分.
在主页上我有一个引用,然后是那个人的名字.我想将他的名字链接到我的"关于"部分的"即将举办的活动"标签.
该网站是http://www.verticalministries.net.名称"Aaron Ivey"需要链接到"关于"部分下的"即将发生的事件"选项卡.该网站是一个单页的投资组合,使用JavaScript滚动.
我已经尝试使用name属性,但这不起作用,因为href标签看起来像是<a href="#about#ivey>Aaron Ivey</a>无效的代码,因为我有通过类滚动的页面.我确实检查了name属性,我确实给了它#ivey.
<div class="fifth_page" style="display:none">
<h1>Upcoming Events</h1>
<h4>Feb. 15 - Aaron Ivey Band</h4>
<a name="#ivey"></a>
<img src="images/iveypromo.jpg" alt="Aaron Mug Shot" class="floatRight img_left_space" />
<p> “Aaron Ivey believes that all worship is a response to a creative and compelling God. Serving as one of the worship pastors at <a href="http://www.austinstone.org" target="_blank">The Austin Stone</a>...</p>
</div>
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激.
如果您还有其他问题,请告诉我.
谢谢.
此致
DHJolesch
不要使用name它已弃用的属性,而是使用id
示例代码,如何使用指定的id 跳转anchor到a div:
<a href="#your-page-element">Jump to ID</a>
<div id="your-page-element">
will jump here
</div>
Run Code Online (Sandbox Code Playgroud)
同样用jQuery滚动动画看看如何使用jquery滚动到页面上的特定位置?