.fadein img { position: fixed; left: 0; top: 0; z-index: 0; object-fit: cover; width: 100vw; height: 100vh; } .fadein:after{ background: url(../img/pattern.png) repeat top left; content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 98; }