一个坑,input的type="datetime-local" 时,电脑上会显示提示,如图

<input type="datetime-local" name="user_date" placeholder="请选择时间" />

input type="datetime-local" 时placeholder不显示

但是,手机上不会显示,就是一片白,加上placeholder也是白费。

添上这段代码,亲测ios可以正常提示提示信息,安卓还是一片白。

input[type="datetime-local"]:before{
    content: '填写预约时间';
    color: #a9a9a9;
    text-align: left;
    width:100%;

}
input[type="datetime-local"]:active:before, input[type="datetime-local"]:hover:before, input[type="datetime-local"]:visited:before,  input[type="datetime-local"]:focus:before{
    content: '';
    width: 100%;
}

如果提示信息不是垂直居中,要设置input的高度和行高。

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
猜你喜欢
  • 2022-12-23
  • 2022-01-02
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案