visit
/* youtube embed wrapper */
[data-responsive-youtube-container] {
position: relative;
width: 100%;
height: 0;
padding-bottom: 56.25%;
margin: 1em 0;
}
[data-responsive-youtube-container] > iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
I adapted it to use AVO 🥑 CSS, my data attributes specification of . But I didn’t write the styles. I hate magic numbers like 56.25%
, and I would have tried to avoid it until giving up 😆
Wrap it in a block-element container with the data-responsive-youtube-container
selector.
I’m @chantastic
on Twitter and Discord.