链接到网页的特定部分 [英] Linking to a specific part of a web page
本文介绍了链接到网页的特定部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在另一个我无法控制的网站上创建指向长网页的一部分的链接?
How do I create a link to a part of long webpage on another website that I don't control?
我认为您可以使用#的变体在我链接的末尾的partofpage。有什么建议吗?
I thought you could use a variant of the #partofpage at the end of my link. Any suggestions?
推荐答案
只需追加一个#
,后跟ID您正在尝试的< a>
标记(或其他HTML标记,例如< section>
)到达,得到。例如,如果您尝试链接到此HTML中的标题:
Just append a #
followed by the ID of the <a>
tag (or other HTML tag, like a <section>
) that you're trying to get to. For example, if you are trying to link to the header in this HTML:
<p>This is some content.</p>
<h2><a id="target">Some Header</a></h2>
<p>This is some more content.</p>
您可以使用链接< a href =http:// url.to.site/index.html#target\">Link</a>
。
这篇关于链接到网页的特定部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文