Web Dev
EN
Flexible Captioned Slanted Images
[]
24 ways
A width of 25% works if it’s known there will be always four images, but what if the number of images might vary?
So rather than try to swap carefully-sized images in and out at various breakpoints, or complicate the structure with a wrapper element set to suppress overflow of resized images, I turned to object-fit .
You can use it to resize image content within the image’s element box without creating distortions.
Fully responsive slanted images with text, in an accessible markup structure.
I promised to say why I used padding for the caption text div rather than margins.
['images'
'monoliths'
'element'
'li'
'flexible'
'div'
'width'
'right'
'captioned'
'100'
'text'
'slanted'
'set']