I want to make a button that displays a background color when hovering and a button color without a background color when the button is down. Here is my current code:
You have to set a new background color on :hover
state
.windowButton:hover {
background-color:#1a82b8;
}
.windowButton:active {
fill:#1a82b8;
background-color:#000000;/*You can put the color you want*/
}
Pseudo states inherit values. For consistency purposes, it is best to only declare the styles which you are changing in your pseudo state rules.
Note: :hover
MUST come after :link
and :visited
(if they are present) in the CSS definition, in order to be effective!
How about this?
I would guess, its cause on the first property you are using background-color and the second fill.
button:hover {
background-color: red;
}
button:active {
background-color: blue;
}
jsFiddle working example (1)
`button:hover{background-color: transparent;color: yellow;}
button:active {background: white;color: black;}`