1.隐藏光标
<style>
input{
color: transparent;
}
</style>
2.显示文字
<style>
input{
color: transparent;
text-shadow: 0 0 0 #000;
}
</style>
以上的方法可能在PC或者安卓的手机上是好的,在IOS系统就不行了。
在ios中采取的方法是将输入框光标移走:
input {
opacity: 0;
z-index: 999;
outline: none;
border: none;
color: transparent;
text-indent: -999em;
margin-left: -100%;
width: 200%;
}