.agentPage { background-image: url('../images/Agent1.jpg'); background-repeat: no-repeat; background-size: cover; background-attachment: scroll; } @media screen and (min-width: 992px) { .miniHero { background-position-y: -150px; } } .center{ height: 25vh; /* Magic here */ background-color: #e7dec8; display: flex; justify-content: center; align-items: center; } .agent{ padding-left: 16%; padding-top: 15px; } .buttonfriend{ padding-top: 15px; padding-left: 120px; }