Source : Align a pseudo element to the right and vertical center.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
.holder{ width: 100%; background: tomato; height: 180px; line-height: 180px; position: relative; } .holder::after{ content: ""; background: blue; width:30px; height: 30px; position: absolute; right: 0; top: 50%; transform: translateY(-50%); } |
1 2 3 |
<div class="holder"> Section 1 </div> |