I am working on a WordPress theme. Initially its bootstrap template has been created. Currently I have an issue in its slider for the testimonials section.
I am using Owl Carousel to create the slider. I have included the following shortcode inside the div
in my index.php
file:
<?php
echo do_shortcode('[owl-carousel category="testimonial" singleItem="true" autoPlay="true"]');
?>
The slider includes a statement given by the client with the client’s image at the bottom in a circle. For the image, I have its CSS looking like:
.img-circle {
margin-top: 20px;
height: auto;
width: 100px;
}
Though the width of the image has been specified but the image picks up the entire width of the div
of which it is a part. I want to display only one client in one slide, so I have used singleItem="true"
in the short-code. Have been unable to get the required image dimensions. How to contain the image to the required dimensions?
You have to give the width and height attributes to the img markup. Also, it will need to be
display: block
in order to ignores owl-carousel’s 100% width.You could also include a wrapper around it, will work better.
CSS
HTML
If you can`t edit HTML, try applying CSS to your img tag instead:
Check this for more details: http://owlgraphic.com/owlcarousel/demos/one.html