CSS selector for advanced select element (dropdown)

How can I erase the difference when opening or closing? Are there any pseudo selectors or tricks? no javascript of course.

<select>
  <option> op1 </option>
  <option> op2 </option>
</select>

      

and: the hover doesn't really fit my need because when the dropdown expands, I can move the cursor. it is still open, but the: hover style no longer applies.

+3


source to share


1 answer


Are you looking for :hover

?

This is the state of the element if the mouse is over it.



a {
  color: blue;
}
a:hover {
  color: red;
  text-decoration: overline;
}
      

<a href="#">Move the mouse over me</a>
      

Run code


-1


source







All Articles