gpt4 book ai didi

html - 如何更改svg中圆圈的大小?

转载 作者:太空宇宙 更新时间:2023-11-04 12:15:51 25 4
gpt4 key购买 nike

这是我的 jsfiddle:Fiddle

现在我需要减小 Greeb 色圈的大小并增加红色圆圈的高度。并在大圆圈的每个部分内旋转文本。

html:

<svg width="500" height="500" viewBox="-2 -2 202 203" shape-rendering="geometricPrecision">
<a xlink:href="#"><path class="frag" d="M100,100 v-100 a100,100 1 0,1 86.6025,50" /><text x="135" y="42.5" text-anchor="middle">Endorsements</text></a>
<a xlink:href="#"><path class="frag" d="M100,100 l86.6025,-50 a100,100 1 0,1 0,100" /><text x="170" y="105" text-anchor="middle">personal life</text></a>
<a xlink:href="#"><path class="frag" d="M100,100 l86.6025,50 a100,100 1 0,1 -86.6025,50" /><text x="135" y="170" text-anchor="middle">Place I am visited</text></a>
<a xlink:href="#"><path class="frag" d="M100,100 v100 a100,100 1 0,1 -86.6025,-50" /><text x="65" y="170" text-anchor="middle">Academy</text></a>
<a xlink:href="#"><path class="frag" d="M100,100 l-86.6025,50 a100,100 1 0,1 0,-100" /><text x="27.5" y="105" text-anchor="middle">awards</text></a>
<a xlink:href="#"><path class="frag" d="M100,100 l-86.6025,-50 a100,100 1 0,1 86.0025,-50" /><text x="65" y="42.5" text-anchor="middle">Career Overview</text></a>
<a xlink:href="#"><path class="center" d="M100,100 v-50 a50,50 1 0,1 0,100 a50,50 1 0,1 0,-100" /></a>
</svg>

我可以知道这个怎么做吗?

这是我第一次使用 svg。

谁能帮我解决这个问题?提前致谢。

最佳答案

看到这个:http://jsfiddle.net/q611wenr/2/

我已经用 <circle> 更改了红色圆圈路径, 文本的旋转变换完成了这项工作。

<a xlink:href="#">
<circle cx="100" cy="100" r="70" stroke="red" stroke-width="3" fill="red" />
</a>

.frag {
fill: green;
stroke: #FFFFFF;
transition: fill 0.3s;
}
.center {
fill: red;
width: 50%;
}
a:hover .frag {
fill: #FFC722;
}
text {
font-size: 5px;
fill: #fff;
}
.mid-up-left {
-ms-transform: rotate(-38deg);
-webkit-transform: rotate(-38deg);
transform: rotate(-38deg);
}
.mid-up-right {
-ms-transform: rotate(38deg);
-webkit-transform: rotate(38deg);
transform: rotate(38deg);
}
.mid-down-left {
-ms-transform: rotate(38deg);
-webkit-transform: rotate(38deg);
transform: rotate(38deg);
}
.mid-down-right {
-ms-transform: rotate(-25deg);
-webkit-transform: rotate(-25deg);
transform: rotate(-25deg);
}
<svg width="500" height="500" viewBox="-2 -2 202 203" shape-rendering="geometricPrecision">
<a xlink:href="#">
<path class="frag" d="M100,100 v-100 a100,100 1 0,1 86.6025,50" />
<text x="135" y="-60.5" text-anchor="middle" class='mid-up-right'>Endorsements</text>
</a>
<a xlink:href="#">
<path class="frag" d="M100,100 l86.6025,-50 a100,100 1 0,1 0,100" />
<text x="185" y="105" text-anchor="middle">personal life</text>
</a>
<a xlink:href="#">
<path class="frag" d="M100,100 l86.6025,50 a100,100 1 0,1 -86.6025,50" />
<text x="50" y="222" text-anchor="middle" class='mid-down-right'>Place I am visited</text>
</a>
<a xlink:href="#">
<path class="frag" d="M100,100 v100 a100,100 1 0,1 -86.6025,-50" />
<text x="145" y="108" text-anchor="middle" class='mid-down-left'>Academy</text>
</a>
<a xlink:href="#">
<path class="frag" d="M100,100 l-86.6025,50 a100,100 1 0,1 0,-100" />
<text x="15" y="105" text-anchor="middle">awards</text>
</a>
<a xlink:href="#">
<path class="frag" d="M100,100 l-86.6025,-50 a100,100 1 0,1 86.0025,-50" />
<text x="25" y="60.5" text-anchor="middle" class='mid-up-left'>Career Overview</text>
</a>
<a xlink:href="#">
<circle cx="100" cy="100" r="70" stroke="red" stroke-width="3" fill="red" />
</a>
</svg>

希望这对您有所帮助。

关于html - 如何更改svg中圆圈的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28718697/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com