我对 SVG 还很陌生,但我开始使用图表。该图来自这里。我已经搜索了几个小时,但只找到了问题的一半解决方案。正如您从代码片段中看到的,如果您将鼠标悬停在图表上,它就会“发光”。但我希望当我悬停在圆圈和“关节”上时,只有圆圈和“关节”才会发光。
我尝试过的:
position: absolute. (此后定位工作很奇怪)我该怎么做才能让圆圈和关节“发光”?
*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body{
height: 100%;
width: 100%;
}
@import url('https://fonts.googleapis.com/css?family=Roboto+Mono:400,500&display=swap');
body {
font-family: 'Roboto Mono', monospace;
}
.graph .labels.x-labels {
text-anchor: middle;
}
.graph .labels.y-labels {
text-anchor: end;
}
.graph {
height: 500px;
width: 800px;
}
.graph .grid {
stroke: #ccc;
stroke-dasharray: 0;
stroke-width: 3;
}
.labels {
font-size: …Run Code Online (Sandbox Code Playgroud)