Reddit gives code to embed their comments on website,
for example:
<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>
When you paste it to HTML it renders iframe
with content.
max-width
property of this iframe
is set to 800px
, how can I change it to other value or none
?
in order to override the inline style which you don't have access, you need to use !important
(this is the extremely cases you need to use !important
, otherwise avoid it)
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>