链接到当前页面中的元素 [英] Link to an element within the current page
问题描述
我创建了一个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屋!