Viswa Viswa - 5 days ago 5
CSS Question

ionic 2 - Using thumbnails and avatar inside ion-slide

In, Ionic 2, inside 'ion-slide' doesn't render avatar and thumbnail images in avatar and thumbnail sizes, instead it displays in bigger sizes.

My code:

<ion-slides>
<ion-slide>
<ion-item class="item item-trns item-stable">
<ion-avatar item-left>
<img src="http://placehold.it/300x300" class="avatarImage"/>
</ion-avatar>
<ion-avatar item-right>
<img src="http://placehold.it/300x300" class="avatarImage"/>
</ion-avatar>
</ion-item>
</ion-slide>
</ion-slides>

SCSS:
.avatarImage {
width: auto;
height: auto;
}


Cannot we use avatar inside ion-slide in ionic 2?

Ash Ash
Answer

you need to change image width from width:100% to width:auto.

Comments