Viewing 3 replies - 1 through 3 (of 3 total)
  • I added this CSS to my child theme’s style.css file to center images that are narrower than the slider width:

    .cycloneslider-slide img { /* Cyclone Slider 2 plugin */
    	margin: 0 auto !important; /* center image in slider */
    }
    Plugin Author kosinix

    (@kosinix)

    Hello guys,

    There is a good example on my site: https://www.codefleet.net/cyclone-slider-2/templates/lea/

    Click on the 7th slide with the pictures of wildebeest. As you can see I added a text-align:center on the image containing element:

    .cycloneslider-template-lea .cycloneslider-slide{
         text-align:center;
    }

    and similar to Chad Warner’s comment above, add margin: 0 auto. BUT, adding !important is considered bad practice, so just make your style more specific (you can google that).

    So:

    .cycloneslider-template-lea img{
         display:block;
         margin:0 auto;
    }

    Note, you have to change .cycloneslider-template-lea to the class name of your template.

    Thanks Chad, worked a treat!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I center (crop) images in the slideshow?’ is closed to new replies.