.starRating { display: flex; align-items: center; justify-content: center; } .backStar { position: relative; display: flex; color: #515253; } .frontStar { position: absolute; top: 0; display: flex; overflow: hidden; color: #ffbc0b; }