-1

我无法通过悬停更改 SVG 路径上的不透明度。这是我的代码:

<html>
<head><style>path:hover{opactiy:0.5;}</style></head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<path class='slice' id='slice1' d='M200,200 L199,20 A180,180 0 0,1 380,199 z' fill='#000'/>
<path class='slice' id='slice2' d='M200,200 L380,199 A180,180 0 0,1 305,345 z' fill='#468966'/>
<path class='slice' id='slice3' d='M200,200 L305,345 A180,180 0 0,1 200,380 z' fill='#FFF0A5'/>
<path class='slice' id='slice4' d='M200,200 L200,380 A180,180 0 0,1 54,94 z' fill='#FFB03B'/>
</svg>
</body>
</html>
4

2 回答 2

3

opactiy 不正确,您需要不透明度

于 2012-09-06T21:10:39.487 回答
3

有错字:

path:hover{opactiy:0.5;}

它应该是:

path:hover{opacity:0.5;}
于 2012-09-06T21:11:33.460 回答