* { box-sizing: border-box; } html, body { margin: 0px; height: 100%; } .modal.background { background-image: url('/tip.jpg'); background-position: center; background-repeat: no-repeat; background-size: cover; height: 100%; width: 100%; position: absolute; } .modal.content { width: 95%; } .modal.box { background-color: #A9D0F5; border-radius: 15px; text-align: center; margin: 6em auto; width: 50%; -webkit-animation-name: from_top; -webkit-animation-duration: 1.5s; animation-name: from_top; animation-duration: 1.5s; } #video { background-image: url('/willpower.gif'); background-position: center; background-repeat: no-repeat; background-size: cover; height: 100%; width: 100%; z-index: 255; position: absolute; display: none; } .modal.loader { border: 16px solid #F0F0F0; border-top: 16px solid #000000; border-radius: 50%; width: 120px; height: 120px; animation: spin 2s linear infinite; margin: -4em auto auto -4em; display: flex; top: 50%; left: 50%; position: absolute; } @-webkit-keyframes from_top { from { margin: -6em auto; opacity: 0; } to { margin: 6em auto; opacity: 1; } } @keyframes from_top { from { margin: -6em auto; opacity: 0; } to { margin: 6em auto; opacity: 1; } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }