Hi I was wondering how to give a datalist and the corresponding input the same width. I tried the following :
input {
width: 100%;
padding: 12px 20px 12px 40px;
border: 1px solid #ddd;
margin-bottom: 12px;
}
datalist,option{
width: 100%;
}
<input list="myList"/>
<datalist id="myList">
<option> This is a great option</option>
</datalist>
The datalist is not the input width when I use the code above. Does anyone know how to make a datalist with the same length as the input he belongs to. Thanks in advance.