Home > OS >  How can i fix the size for my custom carousel
How can i fix the size for my custom carousel

Time:12-17

I tried adding an image carousel to my modal,but the carousel shifts dimensions for different image sizesenter image description hereenter image description here

CodePudding user response:

You can set at fixed height for your carousel using css so that the carousel box is always the same size:

. carousel{
  height:400px;
  width:300px;

Or you can probably set the height and width for each images you are using in your carousel in the same way

. carousel_image{
  height:400px;
  width:300px;

CodePudding user response:

Try Below code:

<ngb-carousel>
<ng-template ngbSlide>  
<img src="https://d2g9wbak88g7ch.cloudfront.net/bannerimages/46_inr.png" style="height:300px;width:100%">
</ng-template>  
</ngb-carousel>  

  • Related