gpt4 book ai didi

html - 如何在 HTML 中创建指向脚注的链接?

转载 作者:技术小花猫 更新时间:2023-10-29 11:44:14 27 4
gpt4 key购买 nike

例如:

This is main body of my content. I have a footnote link for this line [1]. Then, I have some more content. Some of it is interesting and it has some footnotes as well [2].

[1] Here is my first footnote.

[2] Another footnote.

因此,如果我单击“[1]”链接,它会将网页定向到第一个脚注引用等。我究竟如何在 HTML 中完成此操作?

最佳答案

给容器一个 ID,然后使用 # 来引用该 ID。

例如

<p>This is main body of my content. I have a footnote link for this line <a href="#footnote-1">[1]</a>. Then, I have some more content. Some of it is interesting and it has some footnotes as well <a href="#footnote-2">[2]</a>.</p>

<p id="footnote-1">[1] Here is my first footnote.</p>
<p id="footnote-2">[2] Another footnote.</p>

关于html - 如何在 HTML 中创建指向脚注的链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66964/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com