Full Screen HTML5 Video Background without JS

后端 未结 4 1116
孤街浪徒
孤街浪徒 2020-12-21 04:13

I would like to create a full-screen video background on my website, ideally using only HTML and CSS. I also need the video background to be stuck to the top of the page, so

4条回答
  •  有刺的猬
    2020-12-21 05:00

    Likely this will work-

    .video-container{
    width:100vw;
    height:100vh;
    }
    

    Where vw is viewport width and vh is viewport height.

提交回复
热议问题