例如:
因此,如果我单击“[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>