目前,Twitter 关注按钮在我的 Chrome 28 及更高版本的网站上按预期工作。我注意到它生成了一个具有以下属性的 iframe
:
<iframe id="rufous-sandbox" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" style="position: absolute; visibility: hidden; display: none; width: 0px; height: 0px; padding: 0px; border: none;"></iframe>
这是在 body 元素的底部添加的;但是,在 Chrome 27 及以下版本中,它会将其添加到 head 标签和 body 标签之间。此外,它在没有 rufous-sandbox
ID 的情况下添加它,并强制将 body 元素向下“推”,因此顶部有一个大的空白区域。
在 Chrome 27 及以下版本中:
<head>...</head>
<iframe>..</iframe>
<body>...</body>
我该如何解决这个问题?我尝试将相同的样式添加到任何 iframe
元素,但这没有用。 twitter 脚本在 body
元素中,也许我把它放在了错误的地方?它应该在 head
中吗?
最佳答案
我建议你回到推特并获取它的代码,这是我的代码......
<a href="https://twitter.com/GetBorealis" class="twitter-follow-button" data-show-count="false">Follow Us!</a>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
关于html - Twitter 关注按钮在 Chrome 27 及更低版本中无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36929541/