0

I would like to add a custom hover colour and border to the option element using CSS only but I can't figure out how.

What I want it to look like:

What I want it to look like

What it looks like right now:

What it looks like right now

CSS:

option:hover {

    background-color: white;
    color: black;   

}

option {

background-color: black;
color: white;
outline: none;
border-left: 1px solid black;
border-right: 1px solid black;
border: none;   

}

option:focus {

border: none;
border-width: 0;
border-left: 1px solid black;
border-right: 1px solid black;
outline: none:

}

Any help would be greatly appreciated.

Oscar Peace
  • 99
  • 1
  • 2
  • 11
  • IMHO you shouldn't manipulate the browsers behaviour like that for design purposes. People are used to their browsers and may think, the page does not work or whatever. – iquellis Dec 13 '17 at 19:37

1 Answers1

0

Here's an option (no pun intended) which only works in Firefox: Change Select List Option background colour on hover

There is no cross-browser solution for what you are trying to accomplish.

Canica
  • 2,650
  • 3
  • 18
  • 34