I am using ionic 3 ion-slides
and ion-slide
. The issue I am facing is the contents are in the center and I want it to be top aligned. Code looks like:
<ion-content padding>
<ion-slides pager>
<ion-slide style="vertical-align:top">
<ion-card padding>
<ion-card-header class="ha-card-header">About you</ion-card-header>
<ion-card-content>
<ion-label>Family Size <ion-badge>{{energyProfile.familySize}}</ion-badge></ion-label>
<ion-item no-padding>
<ion-range [(ngModel)]="energyProfile.familySize" min="0" max="10" step="2">
<ion-icon range-left small name="person"></ion-icon>
<ion-icon range-right name="people"></ion-icon>
</ion-range>
</ion-item>
</ion-card-content>
</ion-card>
</ion-slide>
</ion-slides>
<ion-content>
You can use a css rule to do that:
ion-slide.swiper-slide {
align-items: flex-start;
}
The default is align-items: center;
.
EDIT:
From @Ryan Coolwebs comments:
You may also find (on some occasions) that you also will now need to adjust the pagination component as it will be under the '.swiper-wrapper' with significant whitespace (i.e placing the
ion-slides
component within col layout).A reasonable solution is to inset the pagination by assigning this css:
ion-slides.slides { height: auto; } .swiper-pagination { bottom: 0px; }
Then adjust the transparency settings and colors of pagination system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With