2010-10-10 9 views
15

Je dois changer la couleur d'un bouton en stationnaire.Comment puis-je changer la couleur d'un bouton en survol?

Voici ma solution, mais cela ne fonctionne pas.

a.button { 
    display: -moz-inline-stack; 
    display: inline-block; 
    width: 391px; 
    height: 62px; 
    background: url("img/btncolor.png") no-repeat; 
    line-height: 62px; 
    vertical-align: text-middle; 
    text-align: center; 
    color: #ebe6eb; 
    font-family: Zenhei; 
    font-size: 39px; 
    font-weight: normal; 
    font-style: normal; 
    text-shadow: #222222 1px 1px 0; 
} 
a.button a:hover{ 
    background: #383; 
} 

Répondre

32

a.button a:hover signifie « un lien qui est en cours planait au-dessus qui est un enfant d'un lien avec la classe button ».

Optez plutôt pour a.button:hover.

10

semble que votre sélecteur est faux, essayez d'utiliser:

a.button:hover{ 
    background: #383; 
} 

Votre code

a.button a:hover 

signifie qu'il va rechercher un élément a intérieur a avec bouton de classe.

0
a.button:hover{ 
    background: #383; } 

fonctionne pour moi, mais dans mon cas

#buttonClick:hover { 
background-color:green; } 
Questions connexes