Ionic slider with different image size or height

I am using ionic slider box but the problem is my ionic slide images are not the same size, its dynamically repeating image is different size using ng-repeat  

                    <ion-slide ng-repeat="sliderimages in sliderimages">
                        <img src={{sliderimages.url}} style="width:100%;height:auto;"/>
                    </ion-slide>
                </ion-slide-box>

      

I used this css to fit the image height for everyone, .slider {height: 200px; width: 100%; } .slider-slide {color: # 000; background-color: #fff; height: 100%; width: 100%; } but the height doesn't fit,fit image

space in above

I need to add any image size and size in ionic slider

+3


source to share


2 answers


max-width: 100vw !important;
max-height: 100vh !important;

      



it worked for me; -)

+2


source


Don't apply an explicit width or height to the image tag. Give it instead:

max-width:100%;
max-height:100%;

      



Example: http://jsfiddle.net/xwrvxser/1/

Sincerely.

+1


source







All Articles