简体   繁体   English

SVG的一部分在悬停时不会改变颜色吗?

[英]Parts of an SVG will not change color on hover?

I have set up a simple color-change hover for an SVG object, however, the center part of the SVG will not change color on hover, only the outer part of the SVG changes. 我为SVG对象设置了一个简单的变色悬停,但是SVG的中心部分不会在悬停时改变颜色,只有SVG的外部会发生变化。 Any suggestions or clues to get the entire SVG to change color on hover? 是否有任何建议或线索可以使整个SVG悬停时改变颜色?

I've also set up a CodePen here: http://codepen.io/codebuddy/pen/HlmuE 我还在这里设置了CodePen: http ://codepen.io/codebuddy/pen/HlmuE

Thanks in advance for any help! 在此先感谢您的帮助!

You could give the polygon arrow element a class ( .inner_arrow ) and then use the following: 您可以给polygon箭头元素一个类( .inner_arrow ),然后使用以下命令:

Updated Example 更新示例

.arrow, .arrow-group path,
.inner_arrow {
  transition: all 1s;
}
.arrow:hover .arrow-group path,
.arrow:hover .inner_arrow {
  fill: red;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM