Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slider revolution responsive background-size value

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

like image 386
yariv bar Avatar asked Feb 13 '17 09:02

yariv bar


People also ask

What is the best image size for Slider Revolution?

You should try using 2650×1900 image or 1024×768 so you can easily manage your layers.

How do I change slider revolution slider size?

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.


1 Answers

A better solution for what you need to do is:

  1. Go to Slider Settings:
    • In 3, Select a slider type: set it to standard slider and load preset Slideshow Full Width.
    • In 4, Slide Layout: select Full-Width and in Desktop set Layer Grid Size to 1920px x 1080px.
    • Save settings
  2. In Slide Editor:
    • Select a background Image with a 1920 x 1080 dimensions
    • In source settings: set background fit to contain, background position to center top.

With this configuration you should see the image fitting in any screen size.

like image 146
Lucas Avatar answered Sep 27 '22 17:09

Lucas