我不知道你是否会喜欢这个,但我建议,改变SVG标签,并使之简单,使用盒子模型或盒子形状与简单的CSS。它看起来有点像这样:
.box {
height: 500px;
width: 800px;
background-color: black;
position: absolute;
left: 280px;
bottom: 50px;
}
.pong1 {
height: 80px;
width: 20px;
background-color: grey;
z-index: 1;
position: absolute;
left: 300px;
bottom: 300px;
}
.pong2 {
height: 80px;
width: 20px;
background-color: grey;
z-index: 1;
position: absolute;
right: 300px;
bottom: 300px;
}
.border:before {
content: "";
position: absolute;
left: 425px;
bottom: 294px;
height: 10px;
width: 36.7%;
border-bottom: 3px dotted white;
transform: rotate(270deg);
}
<div class="box"></div>
<div class="pong1"></div>
<div class="pong2"></div>
<div class="border"></div>
我知道它看起来很笨拙,不完美,但它很有效,很简单,
谢谢您。