Zoom in cover image, if aspect ratio doesn't fit image
-
neunzehnachtneunwrote on Jun 9, 2019, 8:04 AM last edited by neunzehnachtneun Jun 11, 2019, 9:18 AM
Hi together,
first of all, I must once again thank you deeply for creating this theme!A few days ago, I recognized a minor issue using the cover feature. I use a image with aspect ratio 2/3. If the ratio is wider the image is cropped, so it fits the screen. In opposite if the ratio is narrower, the image shows up fully with a white (or grey) bar underneath.
Im my opinion it would be better not to fill up the image with a bar but to crop the image left and right instead to fit into the browser.I don't know, if this can be solved with css, tried something, but actually I didn't know which class I need to adress.
Thanks in advance and cheers!
SebastianPS. If you want to see, what I describe, visit my website and change size of you browser window. ;-)
-
Dear @neunzehnachtneun
you can set the image as a background image.
Then it always fits the screen.Best!
Marius
-
neunzehnachtneunwrote on Jun 10, 2019, 12:23 PM last edited by neunzehnachtneun Jun 10, 2019, 8:23 AM
Well, this is an unexpected solution. But it works.
Thanks! -
Dear @neunzehnachtneun
happy it works!
Best!Marius
4/4
Need custom programming for your Lay Theme site?
I regularly add new features to Lay Theme for free, based on user feedback. But if you or your client need something more specific, I’m happy to offer custom paid programming tailored to your project.
Email info@laytheme.com with the subject "Custom paid programming for Lay Theme" and a short description of what you need — I’ll reply with a cost estimate.
Custom features I build often make it into future Lay Theme updates, so your idea might benefit the whole community.
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it