我正在使用这段代码,但我希望我的填充和描边颜色是从数组中随机选择的。 这是我的 CSS:
<style>
#svg.clickit .logo {
fill: #002100;
stroke: #002100;
transition: 1s;
}
</style>
最佳答案
我会使用 jQuery,即:
var random = Math.floor(Math.random()*array.length)
$('#svg.clickit .logo ').css({ fill: array[random], stroke: array[random] })
关于css - 如何用随机颜色填充 svg?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32788825/