HTML5 video background color not matching background color of website — in some browsers, sometimes

后端 未结 7 1987
[愿得一人]
[愿得一人] 2020-12-14 07:02

I have a video that the client wants to sit \"seamlessly\" in the website. The background HEX color of the video matches the HEX background color of the website, and renders

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 07:37

    Check this working demo.

    Define background color for video container as #e1dcd8;

    or replace your existing css with the following:

     body, html {
      height: 100%;
      margin: 0;
      padding: 0;
    }
    .background {
        background-color: #e1dcd8;
      width: 100%;
      height: 100%;
    }
    
    .video-container{
      background:  #e1dcd8;
    }
    
    video {
      margin-left: 5%;
      margin-top: 5%;
    }
    

提交回复
热议问题