HTML:
<h2 class="title-main">
<span class="title-inside">X</span>
<span class="title-inside">Y</span>
<span class="title-inside">Z</span>
<span class="title-inside">P</span>
<span class="title-inside">Q</span>
<span class="title-outside">R</span>
<span class="title-outside">S</span>
</h2>
CSS:
:host/deep/.title-main {
display: flex;
margin-bottom: 0;
.title-inside {
&:after {
content : '.';
}
}
}
The rendered result is as follows
X.Y.Z.P.Q.R S
I am trying to avoid the dot for the last child. I want the output to look like this
X.Y.Z.P.Q R S
I have attempted various approaches. For instance, one of the methods I tried is shown below
.title-inside:last-child ::after {
content: ''
}
Unfortunately, this approach did not work. Can someone provide assistance?