如何添加货币“$”输入MDL(Material Design Lite)

时间:2017-01-24 15:46:41

标签: html5 css3 material-design

如何制作货币,例如“$”或用户可以看到输入并保持绝对的文本。

但不要忘记我需要在Material Design Lite上制作

$PORT

1 个答案:

答案 0 :(得分:0)

您不能使用伪元素,例如::after



label::after {
  content: ' $'
}

<form action="#">
  <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
    <input class="mdl-textfield__input" type="text" id="sample3">
    <label class="mdl-textfield__label" for="sample3">Text...</label>
  </div>
</form>
&#13;
&#13;
&#13;

::before

&#13;
&#13;
label::before {
  content: '$ '
}
&#13;
<form action="#">
  <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
    <input class="mdl-textfield__input" type="text" id="sample3">
    <label class="mdl-textfield__label" for="sample3">Text...</label>
  </div>
</form>
&#13;
&#13;
&#13;