I recommend using negative translations. This may be outside the viewport if you do not do it carefully enough.
In addition, you should not embed content with pseudo-elements. Pseudo-elements should only be used for styling. Like this:
body { display: inline-block; } span { display: block; text-align: center; } span:after { content: ''; border-radius: 50%; background-color: #d8d9dd; border: 6px solid #262c40; width: 25px; height: 25px; margin: 10px auto 30px; display: block; }
<span>November 2016</span> <span>May 2016</span>
The text inside the span is centered due to text-align: center
.
The pseudo-element circle is centered due to margin-left: auto
and margin-right: auto
.
source share