Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add custom styling to ion-select

Tags:

css

ionic2

I have a ion-select with few options i gave a header using [selectOptions], is there a way to define a css so that i could able to set background-color to header, button alignment ,and add a icon to the header

 <ion-select [selectOptions]="daysOptions" #selectDays="ngModel" required name="selectedDay" [(ngModel)]="selectDay" >
         <ion-option *ngFor="let day of Days;" [value]="day.val">{{day.name}}</ion-option>
 </ion-select>

could someone help me

like image 770
Yokesh Varadhan Avatar asked Aug 04 '17 11:08

Yokesh Varadhan


1 Answers

You can fix this easily now

Add to ion-select element:

[interfaceOptions]="{cssClass: 'my-class'}"

Add to css:

.my-class .alert-wrapper {
    max-width: 94% !important;
}
like image 96
hoi ja Avatar answered Sep 20 '22 12:09

hoi ja