我想知道是否可以通过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>发布于 2017-03-16 07:57:20
假设您希望iframe向下滚动到h1标记,则可以向URL中添加一个片段,该片段与所需元素的id属性匹配。在这种情况下,它是#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>https://stackoverflow.com/questions/42828194
复制相似问题