How to change the width of a fixed ion-label


#1

What is the right way to change the width of a fixed ion-label?

I have a form with:

<ion-item>
  <ion-label fixed>Fairly long label bla</ion-label>
</ion-item>

I tried to increase the with of the label, because it gets truncated to 100px on the screen:

ion-item {
  ion-label {
    flex: 0 0 200px;
    width: 200px;
  }
}

Why do these styles seem to be ignored?


#2

For what it’s worth, I ran into the same issue (RC4) and found the label adjusted to the size of my label content only after I removed ‘fixed’.


#3

not sure, but this works for me:

<ion-label fixed class='fixedLabel'>E-mail: </ion-label>
    .fixedLabel {
        min-width: 20% !important;
        max-width: 20% !important;
    }

#4

Thanks. This works :slight_smile:


#5

Thanks this actually works.