While on my hunt for an auto-completing text field, I stumbled across lists.
<label>Bad Habit
<input list="badhabits" id="habits" name="habit"/>
</label>
<datalist id="badhabits">
<option value="alcoholics">
<option value="smoking">
</datalist>
They function as expected, but now I'm curious about how to style them. I've attempted to give it an id
and add styles in that way:
#habits{
padding:5px;
border:2px solid #ccc;
-webkit-border-radius: 4px;
border-radius: 5px;
}
I also experimented with:
[type=list] {
padding:5px;
border:2px solid #ccc;
-webkit-border-radius: 4px;
border-radius: 5px;
}
Unfortunately, neither method proved successful. Does anyone out there have any insight into how to style a list?