Skip to content

Snippet: Prevent Image Slider From Stretching Images

By default the Total theme image slider stretches images to fill the parent container, however you can easily disable this with a little custom CSS.

/* Remove image stretch on the Image Slider and center the image */
.wpex-slider-preloaderimg img,
.wpex-slider-media img {
    display: block;
    width: auto !important;
    margin: auto !important;
}

/* Add a dark background behind the Image Slider */
.wpex-slider-media {
    background: #222;
}
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top