I am creating a slider using swiper/angular of categories.
I have category image and category name. How can I get category image and name placed vertically inside a circle?
<div class="slidesContainer" #header>
<swiper #swiperRef mode="ios" [config]="config" >
<ng-template swiperSlide *ngFor="let c of parentCategory.categories let i=index;">
<div id='category_container'>
<div id='category'>
<ion-img [ngStyle]="{'backgroundColor':currentCategory.categoryId==c.categoryId?'blanchedalmond':'#f9f9f9'}" src="{{originalImagePath}}/{{getImageName(c.imageName)}}"></ion-img>
<h2 style="font-size:11px;text-align:center;font-weight: bold;">{{c.categoryName}}</h2>
</div>
</div></ng-template>
</swiper>
</div>
#category_container {
height: 75px;
width: 75px;
background: white;
}
#category {
width: 100%;
//background: #000;
color: #fff;
text-align: center;
ion-img{
border-radius: 50%;
}
}
This is how it is rendered. Some of the images are outside of the div. How to make it perfect for any image size?