Let the video occupy 100% of the screen with fixed height

Asked

Viewed 474 times

1

People would like to know how to leave a video 100% of the screen with fixed height without it being smaller than the image below inserir a descrição da imagem aqui

The idea is that the video occupies all this space in light gray if I leave the video without a height it gets 100% of the screen but it gets to the height very large and if I use a fixed size equal to the image it gets to the right height of the container more does not get the width 100% populated follows a piece of my code

<video src="http://localhost/trustech/image/catalog/video-academia.mp4" muted="true" autoplay="true" loop="true" style="width: 100%; height: 500px;">
  Your browser does not support the video tag.
</video>
  • 1

    This Portuguese there is complicating the understanding. See if this is it http://kithomepage.com/sos/video100.htm

  • and more or less the friend idea is that my video stays in that whole session as it shows in the image above only that so use width:100%; it gets huge the video leaving the session quite big now use width:100; with a height height: 550px; it gets in the correct size of my session but it ends up not occupying all that session I know it is difficult to explain so more can understand now ?

1 answer

0

using css

video {
  position: fixed; /*  absolute ou fixed */
  width: 100%;
  z-index: 20;
  height: 100%;
  left: 0px;
  top: 0px;
}

or style

  <video style="position: fixed; /*  absolute ou fixed */width: 100%;z-index: 20;height: 100%;left: 0px;top: 0px;" src="http://localhost/trustech/image/catalog/video-academia.mp4" muted="true" autoplay="true" loop="true" style="width: 100%; height: 500px;">

Your browser does not support the video tag.

  • I think he doesn’t want the video to go along with the scroll, but it has a cool height, a little confusing question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.