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的解决方案,我可以使用。
感谢您提前提供任何帮助!