我一直在尝试在 input type='datetime-local' 字段中添加占位符,但它根本不起作用。使用css解决问题但仍然无法做到:(
input[type="datetime-local"]:before{
content: 'Selecteer Datum';
color: #000;
text-align: center;
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%;
}Run Code Online (Sandbox Code Playgroud)
<form action="" method="post">
<div class="datetime">
<input type="datetime-local" >
</div>
</form>
Run Code Online (Sandbox Code Playgroud)