Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
How to add image to the Selected option in Select and how to change the options hover default color?

I am using the html "select"

const selectedvalue = "male"
<select>
    <option className={selectedvalue == "male" ? "selectedoption" : } selected={selectedvalue == "male" ? "selected" : false} value={"male"}>male</option>
    <option className={selectedvalue == "female" ? "selectedoption" : false} selected={selectedvalue == "female" ? "selected" : false}value={"female"}>female</option>
</select>

CSS Code:

.selectedoption{
   color: #DB1962;
   background-image: url("my base 64 code")
 }
 option:hover{
   background-color: "#FFF"  
 }

I am using the background color for option hover, but still i am getting the default background color on hover.

And on the Selected value with selectedoption class i can able to get the color but image i am not able to get I want the Tick icon to be displayed on the selected option.

Thanks in Advance.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda