(CSS) Can I make background-size 'contain' or 'cover' do this?
I've been toying with full-size background images, alternating between background-size: cover and contain. After some testing, I'm wondering if the behavior I'm looking for is even doable. Thought I'd ask here.
The image is of a standing silhouette.
The behavior I'm looking for is :
- PROPORTIONALLY:
Must retain original proportions at all times. - VERTICALLY:
Must stretch to fill 100% viewport height at all times. - HORIZONTALLY:
- If width is larger than image, left-justify.
- If width is narrower, right-justify.
(In other words, crop left side out of the viewport so the right side of the image remains in view.)
What is the simplest and most code-efficient way to obtain this result?
Thanks!
