大家好,我是SVG的新手,我已经搜索了很多次这个问题,但是解决方案不起作用,你怎么能把一些文本放在里面,我的文本元素被我的循环svg重叠了。我也有另一个想法,我将编辑svg,并将一些文字在adobe插画,但我想要一个按钮在其中。
抱歉,我的语法不好
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
header {
height: 100vh;
width: 100%;
}
.svg-container {
display: flex;
justify-content: center;
align-items: flex-end;
height: 80%;
width: 100%;
flex-direction: column;
background-color: blue;
}<div class="svg-container">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1093.75 634.38">
<defs>
<style>
.cls-1,
.cls-2,
.cls-3,
.cls-4 {
fill: #e6e7e8;
stroke-miterlimit: 10;
}
.cls-1 {
stroke: #e6e6e6;
stroke-linecap: round;
}
.cls-2 {
stroke: #ccc;
}
.cls-3 {
stroke: #b3b3b3;
}
.cls-4 {
stroke: #999;
}
</style>
</defs>
<title>Circles</title>
<g id="Circle4">
<text x="100"
y="50"
font-family="Verdana"
font-size="35"
fill="red">
Hello
</text>
<circle class="cls-1" cx="997.99" cy="538.62" r="90.18" />
</g>
<g id="Circle3">
<circle class="cls-2" cx="806.72" cy="457.71" r="149.49" />
</g>
<g id="Circle2">
<circle class="cls-3"
cx="529.65"
cy="374.1"
r="189.38"
transform="translate(-109.39 484.09) rotate(-45)" />
</g>
<g id="Circle1">
<circle class="cls-4" cx="260.7" cy="264.41" r="253.75" />
</g>
</svg>
</div>
发布于 2020-09-14 14:42:11
您需要重新排序元素,并将text放在末尾。
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
header {
height: 100vh;
width: 100%;
}
.svg-container {
display: flex;
justify-content: center;
align-items: flex-end;
height: 80%;
width: 100%;
flex-direction: column;
background-color: blue;
}<div class="svg-container">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1093.75 634.38">
<defs>
<style>
.cls-1,
.cls-2,
.cls-3,
.cls-4 {
fill: #e6e7e8;
stroke-miterlimit: 10;
}
.cls-1 {
stroke: #e6e6e6;
stroke-linecap: round;
}
.cls-2 {
stroke: #ccc;
}
.cls-3 {
stroke: #b3b3b3;
}
.cls-4 {
stroke: #999;
}
</style>
</defs>
<title>Circles</title>
<g id="Circle4">
<circle class="cls-1" cx="997.99" cy="538.62" r="90.18" />
</g>
<g id="Circle3">
<circle class="cls-2" cx="806.72" cy="457.71" r="149.49" />
</g>
<g id="Circle2">
<circle class="cls-3"
cx="529.65"
cy="374.1"
r="189.38"
transform="translate(-109.39 484.09) rotate(-45)" />
</g>
<g id="Circle1">
<circle class="cls-4" cx="260.7" cy="264.41" r="253.75" />
</g>
<text x="100"
y="50"
font-family="Verdana"
font-size="35"
fill="red">
Hello
</text>
</svg>
</div>
https://stackoverflow.com/questions/63886496
复制相似问题