I created a slide in my WordPress site and I want the background of the slide to be background-size: cover
on desktop and background-size: contain
on mobile. I tried to achieve that by using media queries like so:
@media screen and (min-width: 320px) and (max-width: 675px) {
.tp-bgimg {
background-color: rgb(6, 6, 6) !important;
background-size: contain !important;
}
}
But there is a time gap between the load of the slide and until the media query takes place, so i first see the background as cover
and after a sec or two it changes to contain
, any idea how can i solve this issue?
thx
You should try using 2650×1900 image or 1024×768 so you can easily manage your layers.
To change the dimensions of the slider, scroll down to the Slide Layout Section. To change the height of your slider, you'll need to alter the Layer Grid Size. Please keep in mind that this will affect the entire slider and that the content of individual slides might need to be adjusted to match the new height.
A better solution for what you need to do is:
With this configuration you should see the image fitting in any screen size.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With