我想知道我是否可以通过iframe中的链接定向(Src)引用特定标记(在我们的示例H1中)。
我想知道我是否可以参考以下链接中的第一个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>
答案 0 :(得分:0)
假设您希望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>