fail to change placeholder color with Bootstrap 3

前端 未结 10 986
暗喜
暗喜 2021-01-31 01:27

Two questions:

  1. I am trying to make the placeholder text white. But it doesn\'t work. I am using Bootstrap 3. JSFiddle demo

  2. Another question is h

10条回答
  •  死守一世寂寞
    2021-01-31 01:55

    Boostrap Placeholder Mixin:

    @mixin placeholder($color: $input-color-placeholder) {
      // Firefox
      &::-moz-placeholder {
        color: $color;
        opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
      }
      &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
      &::-webkit-input-placeholder  { color: $color; } // Safari and Chrome
    }
    

    now call it:

    @include placeholder($white);
    

提交回复
热议问题