3 ms·
.bg-video { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); min-width: 100%; mi
by wanda 10y ago
.bg-video {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -1
/* don't set a background color or image on body */
}
I mean, why do you need JavaScript?
- angry-hacker 10y agoBecause the dimension are wrong. Right now you can get it right only with javascript.
- gelatocar 10y agoWhat do you mean by the dimensions are wrong? I use the same css above and it works fine.
- angry-hacker 10y agoFrom the submission's page: codetheory.in/html5-fullscreen-background-video/ This explains it what problem does it try to solve.