简体   繁体   English

如何更改悬停在 SVG 路径文件中的背景

[英]how to change background on hover in SVG path file

I want to change the background color on mouse hover in this country我想在这个国家更改鼠标悬停时的背景颜色

my try:我的尝试:

.sa:hover{
background: #DDD;
}

and I do not know how to remove this line我不知道如何删除这一行在此处输入图片说明

thanks谢谢

For remove back that line you must remove this from svg ,2.74927 -0.013 and you must remove fill:#000 you can use this code in your svg file or you can use !important in your css file要删除该行,您必须从 svg ,2.74927 -0.013删除它,2.74927 -0.013并且必须删除fill:#000您可以在 svg 文件中使用此代码,也可以在 css 文件中使用 !important

Your svg file你的 svg 文件

<?xml version="1.0" encoding="UTF-8" standalone="no"?>



<svg
   xmlns="http://www.w3.org/2000/svg"
   version="1.1"
   height="476.7276"
   width="939.74725"
   viewBox="0 0 2752.77 1537.63"
   id="svg2"
   sodipodi:version="0.32"
   inkscape:version="0.48.2 r9819"
   sodipodi:docname="Middle East Internet 2011.svg"
   inkscape:output_extension="org.inkscape.output.svg.inkscape">




  <g
          transform="matrix(4.1453484,0,0,4.0668378,-4831.9096,-1805.3352)"
          class="landxx coastxx sa"
          id="sa"
          style="">

    <path
            class="landxx sa"
            d="m 1624.548,662.653 c 0.097,-0.908 -0.457,-3.06 -1.274,-3.58 -0.416,-0.265 -2.431,-4.499 -2.315,-2.456 -0.187,-3.659 -2.723,-4.6 -4.741,-7.077 -0.764,-0.938 -1.842,-2.292 -2.2,-3.439 -0.463,-1.48 -1.298,-1.902 -2.056,-3.105 -0.444,-0.706 -0.066,-1.322 -0.578,-2.047 -0.365,-0.515 -0.975,-2.154 -1.216,-2.815 -0.226,-0.619 -0.363,-1.273 -0.653,-1.868 -0.267,-0.547 -0.824,-0.624 -1.092,-1.105 -0.256,-0.462 -0.01,-1.092 -0.359,-1.497 -0.359,-0.409 -0.945,-0.466 -1.334,-0.828 -0.977,-0.909 -2.108,-1.828 -2.971,-2.841 -1.047,-1.23 -2.274,-0.715 -3.455,-1.585 -1.959,-1.446 -3.262,-4.131 -4.493,-6.187 -0.717,-1.197 -0.511,-1.882 -0.571,-3.145 -0.066,-1.368 -1.056,-2.5 -1.158,-3.883 -0.134,-1.815 0.617,-3.62 0.256,-5.428 -0.165,-0.824 -0.615,-1.521 -1.057,-2.216 -0.232,-0.366 -1.639,-2.181 -0.051,-0.94 -0.349,-0.912 -1.142,-0.922 -1.348,-1.921 -0.185,-0.893 -0.623,-1.87 -0.972,-2.713 -0.966,-2.335 -2.851,-3.926 -4.618,-5.606 -1.289,-1.224 -2.566,-1.417 -4.138,-1.847 -0.67,-0.183 -0.99,-1.458 -1.187,-2.002 -0.422,-1.166 -1.238,-1.966 -1.969,-2.938 2.53,-0.922 -0.994,-5.075 -1.82,-6.08 -0.557,-0.675 -2.12,-1.905 -2.053,-2.796 0.117,-1.535 -1.86,-2.422 -2.525,-3.803 -2.016,-4.19 -5.198,-7.671 -7.432,-11.782 -0.681,-1.252 -1.441,-3.183 -2.942,-3.606 -0.682,-0.192 -3.364,-0.638 -3.417,0.621 -0.897,-0.82 0.553,-2.975 0.805,-3.836 0.528,-1.805 0.106,-3.68271 0.401,-5.505 0.3737,-2.30852 0.014,-0.8716 0.3385,-2.24737 1.723,0.51257 6.4635,1.78516 8.1825,1.41037 3.415,-0.74456 3.361,-5.71 6.57,-6.216 1.203,-0.19 4.1559,0.11407 4.027,-1.508 -0.2941,-3.69942 1.3153,-2.58881 3.5546,-3.34406 -2.9226,-2.79949 -5.703,-5.71917 -8.3765,-8.754 5.1925,-1.08478 8.6393,-2.25469 14.76,-5.52458 2.5927,0.49723 7.217,0.77985 10.0595,2.09578 9.5514,4.4217 17.4184,11.18186 25.7094,17.49086 1.756,1.337 3.465,2.664 5.104,4.137 1.867,1.677 3.1647,1.59327 5.6247,1.83127 2.836,0.274 5.8243,0.67473 8.6613,0.93673 1.041,0.097 1.555,-0.434 2.685,-0.19 1.527,0.329 3.111,0.515 4.666,0.656 1.648,0.148 1.778,2.064 2.304,3.277 0.779,1.802 3.404,0.664 4.894,0.795 1.541,0.136 1.742,0.971 2.246,2.232 0.545,1.365 3.255,3.104 2.834,4.635 -0.139,-0.241 -0.309,-0.457 -0.511,-0.647 -0.461,1.097 0.645,0.972 0.511,1.94 0.019,0.015 4.632,0.442 2.87,1.797 0.676,0.214 2.111,3.675 2.8,1.725 -0.46,1.736 3.706,3.686 4.67,4.741 -0.514,-0.154 -0.897,-0.466 -1.15,-0.934 0.024,1.914 1.184,1.942 1.596,3.478 0.241,0.9 0.145,2.799 -1.165,1.624 0.119,1.021 -0.211,1.224 0.717,1.412 0.143,0.028 1.359,2.665 1.443,2.971 -0.27,-0.233 -0.533,-0.473 -0.791,-0.719 0.797,1.169 2.22,1.826 2.85,3.12 0.639,1.308 0.833,2.508 1.601,3.779 0.59,0.978 1.443,2.654 2.665,2.954 0.559,0.137 2.587,-0.393 2.295,0.71 0.214,-0.56 0.699,-0.765 1.221,-0.432 -0.683,0.834 -1.3002,3.10814 1.0068,2.51914 -0.152,0.039 1.1802,2.63645 1.3082,2.81945 2.6599,3.01823 6.2479,8.32765 7.6579,8.89996 8.7636,0.97901 12.8159,1.45516 17.5839,2.51679 0.6215,-0.14882 1.1661,-0.52221 1.3651,-0.92452 1.0641,2.45975 3.4811,3.74705 3.8873,5.344 0.367,1.44291 0.2647,2.40103 -0.1135,3.88483 -1.2662,4.96847 -1.9636,13.91667 -3.7987,14.9054 -12.4941,6.73153 -28.1308,9.08715 -42.979,11.54695 -1.926,0.682 -3.7786,1.55278 -5.5365,2.57009 -2.6434,1.52972 -5.2137,6.12495 -6.0713,8.86805 -0.3963,1.26766 -1.888,2.65572 -3.283,2.66172 -1.458,0.006 -1.7275,-2.3642 -2.9157,-2.76405 -1.3502,-0.45438 -2.3471,0.23562 -3.5112,0.0931 -1.8051,-0.22095 -4.2178,0.0627 -5.8403,-0.77213 -1.949,-1.00286 -3.3851,-0.54262 -5.5441,-0.53836 -1.891,0.004 -3.8878,1.16148 -5.7705,1.13754 -2.3377,-0.0297 -2.6794,-1.80886 -3.896,-1.489 -1.6305,0.42868 -2.063,2.56919 -2.1538,3.92227 -0.09,1.33517 1.5811,2.11151 0.166,3.076 -0.2714,0.18502 -0.5545,2.07645 -2.5891,-0.179 0.1045,-0.22754 0.094,-0.40254"
            id="path3380"
            style="fill-opacity:1;stroke:red;
            inkscape:connector-curvature="0" />

</svg>

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

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