简体   繁体   中英

Responsive height of slider div

I have a problem with swiper slider and I need your help.

Here is my code: http://jsfiddle.net/2Xt7H/4

I want the comm_image_div div which is the slider div to take the height of the image and not to be fixed (200px) as it is in my example.

I prefer to do this with css, but if this isn't possible then the alternative is javascript.

Try using display: inline-block; and delete the height: 200px; in #comm_image_div

Using display: inline-block; will change the div's height and width(if they are not specified) according to its content.

UPDATE: I used height: 100%; in #comm_image_div and img.comm_image_big http://jsfiddle.net/2Xt7H/7/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM