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

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

<input type="datetime-local" name="user_date" 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的高度和行高。

 

posted @ 2016-08-18 16:34  帅气的皮卡丘  阅读(1216)  评论(0编辑  收藏  举报