Css 如何在单击某个区域后阻止SVG颜色的更改?
我有一个svg地图,我不希望在单击某个区域后颜色发生变化。如图所示。访问后,它看起来像一个超链接Css 如何在单击某个区域后阻止SVG颜色的更改?,css,svg,Css,Svg,我有一个svg地图,我不希望在单击某个区域后颜色发生变化。如图所示。访问后,它看起来像一个超链接 .mapdiv { max-width: 45%; height: auto; margin: auto; width: auto; stroke: #a9a9a9!important; stroke-width: 2px; stroke-linejoin: round; fill: #5d6675;!important;} .mapdiv path { opacity: .85; cursor:
.mapdiv {
max-width: 45%;
height: auto;
margin: auto;
width: auto;
stroke: #a9a9a9!important;
stroke-width: 2px;
stroke-linejoin: round;
fill: #5d6675;!important;}
.mapdiv path {
opacity: .85;
cursor: pointer;
-webkit-transition: all 150ms;
-moz-transition: all 150ms;
-o-transition: all 150ms;
transition: all 150ms; }
.mapdiv :hover {
stroke-width: 3px;
stroke-linejoin: round;
fill: #c9b394!important;
cursor: pointer; }
好的,在去掉所有坏习惯后,坏习惯是有原因的!重要信息:从我的CSS中,它得到了修复,不知道为什么或如何,但得到了修复。使用javascript事件侦听器来更改填充,而不是CSS hover我尝试过JS,但没有运气=(“我尝试过…”-请提供tryI使用的JQuery,这里是我使用的$(document).ready(function(){$(“path”).hover(function(){$(this.CSS(“fill”),“#c9b394”)},function(){$(this.css(“fill”,“#5d6675”);});