代码之家  ›  专栏  ›  技术社区  ›  gaurang

带有浮动标签占位符颜色的离子输入在离子中不发生变化

  •  2
  • gaurang  · 技术社区  · 6 年前

    我想更改离子输入的占位符颜色,但无法更改占位符颜色。我有浮动标签的离子输入。这是我的解决方法…

    <ion-item>
        <ion-label floating>first Name</ion-label>
        <ion-input type="text"></ion-input>
    </ion-item>
    

    我试过但没用的…

    1) $text-input-placeholder-color
    

    2)

    ::-webkit-input-placeholder { /* Chrome/Opera/Safari */
      color: pink;
    }
    ::-moz-placeholder { /* Firefox 19+ */
      color: pink;
    }
    :-ms-input-placeholder { /* IE 10+ */
      color: pink;
    }
    :-moz-placeholder { /* Firefox 18- */
      color: pink;
    }
    

    3)

    ::placeholder {
      color: blue;
      font-size: 1.5em;
    }
    

    但什么都不起作用。有人能帮我解决这个问题吗?

    1 回复  |  直到 6 年前
        1
  •  1
  •   Mystery    6 年前

    这不是占位符。它仍然是 ion-label

    要更改浮动离子标签的样式,

    将此添加到 variable.scss

    $label-ios-text-color: blue;
    $label-md-text-color: blue;
    $label-ios-text-color-focused: blue;
    $label-md-text-color-focused: blue;
    

    或者编辑你的 .scss

    .label[floating],
    .label[stacked],
    .input-has-focus .label[floating] {
        color: blue ;
    }