I use the following svg figure as a button:
<svg id="button-more-people" style="width: 60px; height: 60px;">
<circle cx="30" cy="30" r="30" fill="#F44336" id="circle-button-more-people"/>
<text fill="#ffffff" font-size="45" x="11" y="44" font-family="Verdana">+</text>
</svg>
When the mouse hangs over the circle, I scale the button up through css:
#button {
transition: 0.3s ease;
}
#button:hover {
transform: scale(1.2);
}
What I can not achieve is to change the color of the buttons when pressed. I tried the following, to no avail:
#button:active ~ circle {
fill: #D50000;
}
I would prefer if I used a javascript-smaller solution that I could use.
Thanks for any help in advance!
source
share