Changer background DIV au survol d'un autre DIV

Fermé
reedbedroom Messages postés 80 Date d'inscription lundi 11 juillet 2011 Statut Membre Dernière intervention 1 janvier 2020 - 30 déc. 2013 à 12:25
benji69340 Messages postés 29 Date d'inscription lundi 4 avril 2011 Statut Membre Dernière intervention 29 août 2017 - 8 janv. 2014 à 23:47
Bonjour,

Je n'arrive pas a faire ce que je souhaites, et pourtant je sais que cela est possible !

Je m'explique, j'ai un DIV principal avec une photo en background que j'aimerais modifier lors du passage sur un autre DIV (bouton).

Voici mon CSS :


#top-page-contact
{
position: relative;
margin: 0px auto;
background: url(http://www.iwebu.com/hedgeguard_v1/wp-content/themes/hedgeguard/images/fond-contact.png) no-repeat right top;
height: 263px;
width: 1100px;
text-align: center;
padding-top: 280px;
}

#boutonLondon
{
float: left;
width: 200px;
height: 21px;
background-color: #f29413;
margin-top: 20px;
text-align: center;
font-family: 'Gotham A', 'Gotham B'; font-weight: 400; font-style: normal;
color: #fff;
font-size: 12.05px;
padding-top: 5px;
cursor: pointer;
}

#boutonLondon:hover + #top-page-contact
{
background: url(http://www.iwebu.com/hedgeguard_v1/wp-content/themes/hedgeguard/images/fond-contact.png) no-repeat right top;
}


Quelqu'un saurai pourquoi cela ne fonctionne pas ?!!

Merci à Tous !


A voir également:

2 réponses

Angelneonizz Messages postés 784 Date d'inscription mardi 9 décembre 2003 Statut Membre Dernière intervention 19 février 2018 137
31 déc. 2013 à 11:38
Bonjour,

je crois qu'il n'y a pas de +
il faudrait mettre :


#boutonLondon:hover #top-page-contact
{
background: url(http://www.iwebu.com/hedgeguard_v1/wp-content/themes/hedgeguard/images/fond-contact.png) no-repeat right top;
}
0
benji69340 Messages postés 29 Date d'inscription lundi 4 avril 2011 Statut Membre Dernière intervention 29 août 2017 1
8 janv. 2014 à 23:47
Si si, ça aurait du fonctionner avec le "+" , mais je crois savoir que les deux éléments doivent avoir le même parent direct .
A explorer
0
Merci !

J'ai finalement réussi a le faire en javascript ...
0