CSS for YouTube iFrame

pexels-photo.jpg
iframe[src*="youtube.com"] {
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

The provided content is a CSS rule for styling <iframe> elements that contain YouTube videos. It sets the maximum width to 100%, makes the height adaptable (auto), and maintains an aspect ratio of 16:9.

Discover more from Jorge Saldívar

Subscribe now to keep reading and get access to the full archive.

Continue reading