如何在焦点输入中更改不透明度占位符

时间:2017-03-20 12:28:08

标签: css

我需要在输入上更改不透明度:焦点占位符

Html

<input type="text" name="search_cursos" id="search_cursos" placeholder="Procure a vaga que deseja" class="procurarvaga">

我的scss

input.procurarvaga{
        text-align: center;
        &:focus{
            @include placeholder {
                @include opacity(.2);
            }
        }
    }

Mixins

@mixin opacity($opacity) {
  opacity: $opacity;
  // IE8 filter
  $opacity-ie: ($opacity * 100);
  filter: alpha(opacity=$opacity-ie);
}

@mixin placeholder {
  ::-webkit-input-placeholder {@content}
  :-moz-placeholder           {@content}
  ::-moz-placeholder          {@content}
  :-ms-input-placeholder      {@content}
}

我的代码https://jsfiddle.net/fcothiagofreitas/ubxzswkw/

此处使用css work http://jsfiddle.net/XDutj/27/

0 个答案:

没有答案