For the element <video/>
stand at 100% height, the parent element, in this case <div id="video"/>
has to have a defined height.
Similarly, the height should be provided through the CSS property height
.
Two solutions can be implemented, everything depends on the ultimate goal:
100% x 100% solution%
In this solution, the video gets the total width and height of your container, without respecting the Aspect ratio of the same.
body {
margin: 0;
background: #000;
}
#video {
width: 100%;
height: 100%;
}
video {
position: fixed;
right: 0;
bottom: 0;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -100;
transition: 1s opacity;
}
#rodape {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: #FFF;
padding: 10px 20px;
text-align: center;
line-height: 20px;
}
<div id="video">
<video width="100%" height="100%" loop autoplay>
<source src="//demosthenes.info/assets/videos/polina.webm" type="video/webm" />
<source src="//demosthenes.info/assets/videos/polina.mp4" type="video/mp4" />
</video>
</div>
<div id="rodape">Meu Rodapé</div>
Solution preserving the Aspect ratio
In this solution, the video does not "stretch" or "shrink", it keeps its Aspect ratio intact.
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
#video {
width: 100%;
height: 100%;
}
video {
height: 99%;
width: 100%;
background-color: #000;
}
#rodape {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background-color: #FFF;
padding: 10px 20px;
text-align: center;
line-height: 20px;
}
<div id="video">
<video width="100%" height="100%" loop autoplay>
<source src="//demosthenes.info/assets/videos/polina.webm" type="video/webm" />
<source src="//demosthenes.info/assets/videos/polina.mp4" type="video/mp4" />
</video>
</div>
<div id="rodape">Meu Rodapé</div>
@user23633 Done, you now have a solution for 100% x 100% without respecting the Aspect ratio video. Analyzes the first part of the answer.
– Zuul
Interesting hmm he didn’t really modify the video now just speaks the positioning because soon after all I will last a media queries to leave responsive more than previous now I want to fix it at the top and that it is adjusted to the screen size as in that link that I mentioned my menu already this ready Voce commented that this was the first part has more if yes look forward :)
– Felipe Henrique
The "first part" because the answer has two parts, the first being what you were looking for, 100%X100% regardless of the Aspect ratio video. Technically, the problem of your question is solved. If you need help with other details, you should put new question(s) focusing on those details only.
– Zuul