ich will für meinen Blog die Ansicht der Titelbilder einstellbar machen.
https://www.afripix-web.de/blog-webdesi ... -wiehl.php
Aber die Ansicht ist immer 1:1. (auch mit ChatGPT schon gesucht)
Code: Alles auswählen
<input type="radio" title="Bildformat Übersicht 1:1" name="imageRatio" value="square">
<input type="radio" title="Bildformat Übersicht 4:3" name="imageRatio" value="portrait" checked>
<input type="radio" title="Bildformat Übersicht 16:9" name="imageRatio" value="wide">
.blog-image {
width: 100%;
overflow: hidden;
background: #f2f2f2;
}
.blog-image-ratio {
aspect-ratio: (1 / 1);
}
& when (@imageRatio = portrait) {
.blog-image-ratio {
aspect-ratio: (4 / 3);
}
}
& when (@imageRatio = wide) {
.blog-image-ratio {
aspect-ratio: (16 / 9);
}
}
