blachnik

so dies und das ...

Videos im Portrait Modus anzeigen

2025-07-02 Blog Wolfgang

Kleiner Tip für Hugo und das Template Bilberry

Damit Handy Videos im Portrait Modus auch korrekt angezeigt werden muss folgender Eintrag in der Datei ‘’’_articles.scss’’’ angepasst werden:

// Video
&.video,
&.article {
    .responsive-video {
        position: relative;
        aspect-ratio: 16 / 9; // Fallback für landscape

        iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 0;
        }

        // Optional: Anpassung für portrait-Videos per zusätzlicher Klasse
        &.portrait {
            aspect-ratio: 9 / 16;
        }
    }
}

erstellt mit Hilfe von ChatGPT :-)