#loadbar { position: absolute; top: 0; left: 0; height: 0.2em; background-color: rgb(46, 223, 40); z-index: 1; transition: 0.1s; width: 0%; opacity: 0; } #loadbar.loading { opacity: 1; }