On my website, I have a photo section that displays random user-submitted images. I am facing the same challenge of fitting images into a frame, similar to how landscape video is adapted for broadcast television when combined with portrait cell phone video - they often use a blurred and enlarged version to fill the unused space. Is there a way to achieve this effect using CSS alone? So far, all of my attempts have resulted in the blur affecting the entire stack of images and text overlays.
<div class="h-full">
<div style=" background: url('url');background-size:cover;filter:blur(8px);">
<img class="h-[390px] w-full object-contain object-center" src="url">
</div>
</div>
Desired Outcome
https://i.sstatic.net/5zads.png
My Outcome: The image appears twice in portrait mode but is ruined by the blur seeping through.
https://i.sstatic.net/c42uM.png
Extra Credit: Does this visual effect have an official name?