4
點擊我使用下面的SVG繪圖作爲按鈕:更改HTML SVG cricle與CSS填充當
<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>
當鼠標懸停在圈子,我通過CSS了縮放按鈕:
#button {
transition: 0.3s ease;
}
#button:hover {
transform: scale(1.2);
}
我似乎無法實現的是在點擊按鈕時更改按鈕的顏色。我試過以下,無濟於事:
#button:active ~ circle {
fill: #D50000;
}
我寧願如果有一個無javascript的解決方案,我可以使用。
感謝您提前提供任何幫助!