Here is the code I tried,
<select size="10">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="3">four</option>
<option value="3">five</option>
<option value="3">six</option>
<option value="3">seven</option>
</select>
option:checked {
background: #84c0ff linear-gradient(0deg, #84c0ff 100%, #84c0ff 100%);
color: red
}
What I want to do is I want to avoid the color change when focus out. In this example you can see text are black, when click the text it will be white. That is want to avoid. (everytime text color want to be black)
- For example I set the black color to change when click the text
How can I do this?
option:checked {
background: #84c0ff linear-gradient(0deg, #84c0ff 100%, #84c0ff 100%);
color: red
}
<select size="10">
<option value="1">one</option>
<option value="2" selected>two</option>
<option value="3">three</option>
<option value="3">four</option>
<option value="3">five</option>
<option value="3">six</option>
<option value="3">seven</option>
</select>