Here I want to add a pseudo-element to the SVG path. I had tried :after element is shown in the console but not visible. Here I want to add pseudo-class to SVG path. Can anyone suggest to me how can I achieve this output. Is it possible if not then what will be the alternate way to do this? Any kind of help will be appreciated.
.container{
width: 500px;
margin:50px auto;
position:relative;
text-align:center;
}
.test {
position: relative;
}
.test:after {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
width: 100px;
height: 100px;
background: red;
z-index: 999999;
}
<div class='container'>
<svg height="400" width="500">
<path id="lineAB" d="M 100 350 l 150 -300" stroke="red"
stroke-width="3" fill="none" />
<path id="lineBC" class="test" d="M 250 50 l 150 300" stroke="red"
stroke-width="3" fill="none" />
<path d="M 175 200 l 150 0" stroke="green" stroke-width="3"
fill="none" />
<path d="M 100 350 q 150 -300 300 0" stroke="blue"
stroke-width="5" fill="none" />
</svg>
</div>