1

我想知道我是否可以通过 iframe 中的链接定向 (Src) 引用特定标签(在我们的示例 H1 中)。

例如链接http://www.marketwatch.com/story/what-the-fed-raising-rates-would-mean-for-your-credit-cards-and-bank-accounts-2016-12-14

我想知道我是否可以参考下面链接中的第一个 H1(“美联储加息将如何影响数百万美国人”)主要目标是直接查看文章。

<iframe id="iFrame1" scrolling="no" src="http://www.marketwatch.com/story/what-the-fed-raising-rates-would-mean-for-your-credit-cards-and-bank-accounts-2016-12-14#H1" style="overflow: scroll; -webkit-overflow-scrolling: touch;" sandbox=""></iframe>
  • “参考 h1 标签”是什么意思?我的意思是我想将 iframe 向下滚动到该元素。
  • 这个想法是直接到一个特定的 TAG (H1ׂ) 没有 ID 或 CLASS (在所有世界网站上的所有文章都只有一个 H1)。
4

1 回答 1

0

假设您的意思是要iframe向下滚动到h1标签,您可以将片段添加到与id所需元素的属性匹配的 URL。在这种情况下,它是#article-headline. 尝试这个:

<iframe id="iFrame1" scrolling="no" src="http://www.marketwatch.com/story/what-the-fed-raising-rates-would-mean-for-your-credit-cards-and-bank-accounts-2016-12-14#article-headline" style="overflow: scroll; -webkit-overflow-scrolling: touch;" sandbox=""></iframe>
于 2017-03-16T07:57:20.027 回答