Change ion label which is inline to floating based

Hello.I have an inline label for a text box something like this

    <ion-label color="primary">Inline Label</ion-label>
    <ion-input placeholder="Text Input"></ion-input>

I want the label and input box to be inline for devices which has screen size > 540px. And for devices <540px i want the label to behave as floating label.
Can Somebody Please tell me how can i do this