如何改变reddit's嵌入评论框架的最大宽度
How to change max-width of reddit's embed comment iframe?
Reddit给出了在网站上嵌入评论的代码,
例如:<div class="reddit-embed" data-embed-media="www.redditmedia.com" data-embed-parent="false" data-embed-live="false" data-embed-uuid="24a3e666-f855-4664-8e9e-9d040fef3ca6" data-embed-created="2016-06-29T16:56:02.732Z">
<a href="https://www.reddit.com/r/Showerthoughts/comments/2safxv/we_should_start_keeping_giraffes_a_secret_from/cno7zic">Comment</a> from discussion <a href="https://www.reddit.com/r/Showerthoughts/comments/2safxv/we_should_start_keeping_giraffes_a_secret_from/">We should start keeping giraffes a secret from young children. Imagine discovering giraffes exist when you were like 15. "Woah! Check out that long necked horse!"</a>.
</div>
<script async src="https://www.redditstatic.com/comment-embed.js"></script>
当你将它粘贴到HTML中时,它会呈现带有内容的iframe
此iframe
的max-width
属性设置为800px
,如何将其更改为其他值或none
?
小提琴
为了覆盖你没有访问权限的内联样式,你需要使用!important
(这是极端情况下你需要使用!important
,否则避免它)
iframe {
max-width: none !important
}
<div class="reddit-embed" data-embed-media="www.redditmedia.com" data-embed-parent="false" data-embed-live="false" data-embed-uuid="24a3e666-f855-4664-8e9e-9d040fef3ca6" data-embed-created="2016-06-29T16:56:02.732Z"><a href="https://www.reddit.com/r/Showerthoughts/comments/2safxv/we_should_start_keeping_giraffes_a_secret_from/cno7zic">Comment</a> from discussion <a href="https://www.reddit.com/r/Showerthoughts/comments/2safxv/we_should_start_keeping_giraffes_a_secret_from/">We should start keeping giraffes a secret from young children. Imagine discovering giraffes exist when you were like 15. "Woah! Check out that long necked horse!"</a>.</div>
<script
async src="https://www.redditstatic.com/comment-embed.js"></script>
相关文章:
- 添加文字和评论功能更新Div
- 包括用于facebook评论框的JavaScript SDK
- facebook”;添加评论“;popup获胜'不要消失
- 在play2框架中向json对象添加下拉列表项
- Javascript/jQuery压缩一个图像正确的评论帖子,并使用Ajax Laravel 5.2保存到控制器中
- 如何在离子框架+有角度的框架中制作顶部标签
- 如何在另一个html文件的框架中包含图像
- 如何重置内嵌框架
- 聚合物是一个框架而不是一个库.如何模块化地使用web组件
- 用于图像和基于浏览器的图表的图表框架
- 没有装饰的小型浏览器框架
- Chrome开发工具中使用了哪些框架和库
- 闭包js框架-将ArrayBuffer转换为字符串
- 类似于Prism的Knockout js框架
- 在其他javascript框架模板中运行angular指令
- 使用HTML5 JS框架进行本地存储
- 发布到iframe-在iframe而不是父框架中呈现的页面
- 框架集+列IE10
- Dart和第三方CSS和JS框架
- 如何改变reddit's嵌入评论框架的最大宽度