我需要在 React 组件中使用推文按钮的 iframe 版本(不要扰乱 React 渲染工作流程),但是在 Linux/Windows 上 - 使用 Chrome/Firefox 时,滚动条出现(即使有 overflow: hidden
)
<iframe title="Twitter Tweet Button" style="border:0;overflow:hidden;" src="https://platform.twitter.com/widgets/tweet_button.html?count=none&dnt=false&lang=en&size=l&text=%23iframe%20Twitter%20button%20%23css%20problem%20%23overflow&type=share&url=http%3A%2F%2Fcodepen.io%2Ftopheman%2Fpen%2FwKyGPd&via=topheman" data-reactid=".0.2.0.4" height="28px" width="76px"></iframe>
渲染效果很好:
MacOS X - Chrome/Firefox/Safari Windows - 火狐
有什么提示吗?
- 这是一个codepen
- 这是React code on github如果你需要的话
最佳答案
放置属性:
scrolling="no"
在您的 iframe 标签中
关于css - iframe 推特按钮 css 溢出隐藏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33280293/