如何使用 HTML 中的 href 属性为存在于不同网站上的页面的某些部分创建书签?
How to create a bookmark for some section of page which is present on different website using href attribute in HTML?
考虑这样一种情况,我有一个网站有 URL http://www.abcd.com
。假设在这个网站上有一个名为 index.html
的文件。此 index.html
文件包含 HTML 代码。
现在我想在页面 index.html
上为用户提供一个超链接,该链接会将用户重定向到网站 http://www.pqr.com
上某个页面上的位置,例如 about_us.html
。
网站 http://www.pqr.com
页面 about_us.html
上的部分有 id="abt".
我应该如何显示它?
在您的 ABC index.html 页面上,添加以下标记...
<a href="http://www.prq.com/about_us.html#abt">About PQR</a>
有关 how to create links to sections on the same page in HTML 的更多信息。
考虑这样一种情况,我有一个网站有 URL http://www.abcd.com
。假设在这个网站上有一个名为 index.html
的文件。此 index.html
文件包含 HTML 代码。
现在我想在页面 index.html
上为用户提供一个超链接,该链接会将用户重定向到网站 http://www.pqr.com
上某个页面上的位置,例如 about_us.html
。
网站 http://www.pqr.com
页面 about_us.html
上的部分有 id="abt".
我应该如何显示它?
在您的 ABC index.html 页面上,添加以下标记...
<a href="http://www.prq.com/about_us.html#abt">About PQR</a>
有关 how to create links to sections on the same page in HTML 的更多信息。