1
HTML/CSSIntermediate#css#cascade
Use the aspect-ratio CSS property to reserve the correct space and prevent layout shift, combined with width: 100% and height: auto (or object-fit: cover) so images scale responsively.
.thumbnail {
width: 100%;
aspect-ratio: 16 / 9;
object-fit: cover;
}