How to make area be irregular shape not rectangle?

前端 未结 1 864
渐次进展
渐次进展 2021-01-24 09:06

How to make area be irregular shape not rectangle? I used svg code like below, tried to make a map but I just can\'t get it how to make mouse over or click the area not rectangl

1条回答
  •  一向
    一向 (楼主)
    2021-01-24 09:40

    You can use pure CSS to achieve the results you are looking for. Add an id/class to your svg, in this case I added an id of poly1.

    Here is your svg modified JSFiddle: >>>CLICK HERE<<<

    SVG:

    
        
    

    CSS:

    #poly1:hover {
        fill: #ccc;
        stroke: #A71F20;
        stroke-width: 3px;
    }
    

    0 讨论(0)
提交回复
热议问题