background { position: fixed; top: 0px; height: 100vh; z-index: 1; } @media screen and (max-width:1000px) { background { left: -241px; width: 200%; background-size: auto 100%; background-position: 45%; } } @media screen and (min-width:1000px) { background { left: -100px; width: 120%; background-size: 90% auto; background-position: 40%; } } background { transition: all 700ms ease-out; background-image: url(../bg.png); background-repeat: no-repeat; } .about>background { height: 100px; background-size: auto auto !important; }