Discussions

Ask a Question
Back to All

[Bug fix] Embedded iframes with unusal theming

Please let me know if this post should live somewhere else

Hi!

Encountered issues with YouTube iframe embeds applying a bunch of weird margin and padding within markdown-body. The bug looks like it offsets by 15px left and right alternating each individual iframe.

My fix for this issue; by all means not perfect but does the job:

/* YouTubev video weird spacing fix - start */
body .markdown-body>.embed_hasImg:nth-of-type(odd) {
    margin-right: 0px !important;
    padding: 0px !important;
}

body .markdown-body>.embed_hasImg:nth-of-type(even) {
    margin-left: 0px !important;
    padding: 0px !important;
}

.markdown-body .embed-media>:only-child {
    margin: 0px !important;
    border-radius: 6px !important;
}
/* YouTubev video weird spacing fix - end */