Home > Enterprise >  How can I get this rating component automatically centered for both mobile and desktop version?
How can I get this rating component automatically centered for both mobile and desktop version?

Time:04-22

How can I get this rating component automatically centered for both mobile and desktop version? See link to inspect code

enter image description here

CodePudding user response:

.rating-content {
    padding-left: 20px;
    padding-right: 20px;
    background-color: #212832;
    border-radius: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

CodePudding user response:

add these additional styling to .rating-content class.

.rating-content{
    margin: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
  • Related