# Input field with floating label and icon

**URL:** <https://forum.ionicframework.com/t/input-field-with-floating-label-and-icon/98461>\
**Category:** ionic-v3\
**Created:** [July 17, 2017, 11:25am UTC](https://forum.ionicframework.com/t/input-field-with-floating-label-and-icon/98461 "2017-07-17T11:25:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![opahopa](https://avatars.discourse-cdn.com/v4/letter/o/8e7dd6/32.png) [@opahopa](https://forum.ionicframework.com/u/opahopa)\
**Post date:** [July 17, 2017, 11:25am UTC](https://forum.ionicframework.com/t/input-field-with-floating-label-and-icon/98461/1 "2017-07-17T11:25:36Z")

</div>

Greetings.

I feel like this is an extremely typical case i guess there is some out-of-the-box solution.

How do i properly set the in Input field with floating label and icon (icon as a placeholder) ?

Now tried:

```auto
 <ion-list class="items-middle" text-center>
    <ion-item>
      <ion-label color="ligh-grey" floating><ion-icon item-left name="mail"></ion-icon>Email</ion-label>
      <ion-input type="email"></ion-input>
    </ion-item>
    <ion-item>
      <ion-icon item-left name="lock"></ion-icon>
      <ion-label color="ligh-grey" floating>Password</ion-label>
      <ion-input type="password"></ion-input>
    </ion-item>
    <ion-buttons padding-top>
      <button ion-button full round>Login</button>
    </ion-buttons>
  </ion-list>

```

1st case (email input) - icon is in the label. works well for androind & ios, but broken for windows.  
2nd case (pass input) - problem for all devices - elements vertical align. simple css tricks didn’t help.

[http://c2n.me/3McagKW](http://c2n.me/3McagKW)

Thank you.

---

<div class="post-metadata">

**Author:** ![SD1985](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sd1985/32/102473_2.png) [@SD1985](https://forum.ionicframework.com/u/SD1985)\
**Post date:** [July 17, 2017, 12:03pm UTC](https://forum.ionicframework.com/t/input-field-with-floating-label-and-icon/98461/2 "2017-07-17T12:03:13Z")

</div>

Hey I am not an expert but here is my interpretation of the code.

Case 2: The float tag is only applied to the label so the icon is stuck where it is.  
Case 1: is the right approach.

Then again. The I tried the code on plunker. I see a problem here.  
Float tag and placeholder don’t go together (tag and the placeholder sort of are on top of each other in my plunker code. )

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/7/c/7caffb610f6f47dc4a5818588a2c0cca8e544a43.png)

You could use the label as stacked and have a icon placeholder. To do the icon placeholder take a look at this page.

> <https://stackoverflow.com/questions/19350291/use-font-awesome-icon-in-placeholder>

Cheers  
SD

---

<div class="post-metadata">

**Author:** ![opahopa](https://avatars.discourse-cdn.com/v4/letter/o/8e7dd6/32.png) [@opahopa](https://forum.ionicframework.com/u/opahopa)\
**Post date:** [July 17, 2017, 1:17pm UTC](https://forum.ionicframework.com/t/input-field-with-floating-label-and-icon/98461/3 "2017-07-17T13:17:29Z")

</div>

actually not very similar case.

---

<div class="post-metadata">

**Author:** ![opahopa](https://avatars.discourse-cdn.com/v4/letter/o/8e7dd6/32.png) [@opahopa](https://forum.ionicframework.com/u/opahopa)\
**Post date:** [July 20, 2017, 4:58am UTC](https://forum.ionicframework.com/t/input-field-with-floating-label-and-icon/98461/4 "2017-07-20T04:58:31Z")

</div>

Still have this problem. Any suggestion on right solution?

---

<div class="post-metadata">

**Author:** ![shurvirhtml](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/shurvirhtml/32/128643_2.png) [@shurvirhtml](https://forum.ionicframework.com/u/shurvirhtml)\
**Post date:** [November 1, 2019, 4:36am UTC](https://forum.ionicframework.com/t/input-field-with-floating-label-and-icon/98461/5 "2019-11-01T04:36:57Z")

</div>

Try this,

```auto
<ion-item>
  <ion-label position="floating">
    <ion-icon item-left name="mail"></ion-icon>
    Email
  </ion-label>
  <ion-input ></ion-input>
</ion-item>

```
