链接到当前页面中的元素 [英] Link to an element within the current page

查看:92
本文介绍了链接到当前页面中的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个HTML页面,其中包含许多标题如下的表格:Content,Main_Page,Document,Expenses等。

我想创建一个链接页面的顶部。当我点击该链接时,应该转到特定的部分。所以我使用下面的代码来映​​射内容。但它不适合我。

 < a href =#Content>内容部分< / a> 


解决方案

您需要为链接创建锚点。现代的做法是给相应的元素一个 id =Content属性。较早的做法是使用< a name =Content>< / a>


I created a HTML page with a number of tables with headers like this: Content, Main_Page, Document, Expenses, etc.

I want to create a link for the top of the page. When I click that link it should go to the specific section. So I use the below code to map the content. But it's not working for me.

<a href="#Content">Content Section</a>

解决方案

You need to create an anchor for the link. The modern way of doing this is to give the appropriate element an id="Content" attribute. The older way of doing this was to use <a name="Content"></a>.

这篇关于链接到当前页面中的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆