Menu select -> enlever background color de selection

Par Romain Plantureux, il y a 5 ans


Les bases HTML/CSS

Bonjour,

Voila je rencontre un petit problème avec mon code.

Lorsque l'on clic sur mon menu et qu'on passe le curseur sur les différents choix, il y un bleu par défaut qui s'affiche en background. Je n'arrive pas à l'enlever ou à le changer.

HTML

<select class="custom-select" onChange="window.location.href=this.value"> <option value="0">MENU</option> <option value="https://acheteimmo.fr/qui-sommes-nous">Qui Sommes-nous ?</option> <option value="https://acheteimmo.fr/nos-services">Nos Services</option> <option value="https://acheteimmo.fr/infos/">Conseils</option> <option value="https://acheteimmo.fr/realisations">Nos Réalisations</option> <option value="https://acheteimmo.fr/videos">Vidéos</option> <option value="https://acheteimmo.fr/stock">Stock </option> <option value="https://acheteimmo.fr/contact">Contact </option> <option value="https://acheteimmo.fr/">Accueil</option> </select>

CSS

selector .custom-select {font-size: 15px; padding: 2px; position: relative; background-color: #fef200; cursor: grab; } selector .custom-select:hover {font-size: 15px; padding: 2px; position: relative; background-color: #fef200; }

### Voici le bleu que je souhaite supprimer ou remplacer

Ce que j'obtiens

J'arrive a changer le background color on hover (quand j'ouvre le menu la couleur change) mais il y a toujours ce bleu au déplacement de la souris.

Si quelqu'un à la solution ce serait vraiment super.
Merci par avance

2 réponses

Romain Plantureux, il y a 5 ans

Et avec l'inspecteur, impossible de voir à quoi correspond ce bleu..

Romain Plantureux, il y a 5 ans

Bonjour, du coup j'ai procédé autrement.

HTML

<div class="dropdown"> <button class="dropbtn">MENU</button> <div class="dropdown-content"> <a href="https://www.acheteimmo.fr/qui-sommes-nous/">Qui Sommes-nous ?</a> <a href="https://www.acheteimmo.fr/nos-services/">Nos Services</a> <a href="https://www.acheteimmo.fr/infos/">Conseils</a> <a href="https://www.acheteimmo.fr/realisations/">Nos Réalisations</a> <a href="https://www.acheteimmo.fr/videos/">Vidéos</a> <a href="https://www.acheteimmo.fr/stock/">Stock</a> <a href="https://www.acheteimmo.fr/contact/">Contact</a> <a href="https://www.acheteimmo.fr">Accueil</a> </div> </div>

CSS :

/* Style The Dropdown Button */ .dropbtn { background-color: #fef200; color: black; padding: 10px; font-size: 16px; border: none; cursor: pointer; width: 200px; } /* The container <div> - needed to position the dropdown content */ .dropdown { position: relative; display: inline-block; } /* Dropdown Content (Hidden by Default) */ .dropdown-content { display: none; position: absolute; background-color: #fef200; min-width: 200px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } /* Links inside the dropdown */ .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } /* Change color of dropdown links on hover */ .dropdown-content a:hover {background-color: #027934} /* Show the dropdown menu on hover */ .dropdown:hover .dropdown-content { display: block; } /* Change the background color of the dropdown button when the dropdown content is shown */ .dropdown:hover .dropbtn { background-color: #fef200; } </style> selector { text-align: center; } div { text-align: center; }

Voilà merci quand même :-)
Merci pour toutes tes vidéos :-)
Bonne journée