¿Cómo se agrega una superposición de color a un video como este, como se ve aquí:

enter image description here

Aquí está mi código hasta ahora:

HTML

<div>
  <div id="outer">
    <div id="home-top-video">
      <video autoplay loop muted width="100%">
        <source src="http://view.vzaar.com/2710053.mp4" type="video/mp4" /> Your browser does not support the video tag. We suggest you upgrade your browser.
      </video>
      <div id="home-text">
        <div><img src="http://marquesslondon.herokuapp.com/images/logo.ee1689ee.png"></div>
        <h3>LIFESTYLE</h3>
      </div>
    </div>
  </div>
</div>

CSS

#outer {
  width: 100%;
  display: block;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

#home-top-video {
  left: 0%;
  top: 0%;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}

#home-text {
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

Toca el violín aquí: https://jsfiddle.net/kggv3213/1/

css
4
methuselah 24 feb. 2018 a las 13:59

2 respuestas

La mejor respuesta

Puedes probar un pseudo elemento con fondo degradado:

body {
 margin:0;
}
#outer {
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}
#home-top-video:before {
  content:"";
  position: absolute;
  top:0;
  right:0;
  left:0;
  bottom:0;
  z-index:1;
  background:linear-gradient(to right,rgba(65, 0, 255, 0.4),rgba(255, 0, 232, 0.3));
}

#home-top-video {
  left: 0%;
  top: 0%;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}

#home-text {
  position: absolute;
  left: 50%;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  color: #fff;
  z-index:1;
}
<div id="outer">
    <div id="home-top-video">
      <video autoplay loop muted width="100%">
        <source src="http://view.vzaar.com/2710053.mp4" type="video/mp4" /> Your browser does not support the video tag. We suggest you upgrade your browser.
      </video>
      <div id="home-text">
        <div><img src="http://marquesslondon.herokuapp.com/images/logo.ee1689ee.png"></div>
        <h3>LIFESTYLE</h3>
      </div>
    </div>
  </div>
9
Temani Afif 3 jun. 2020 a las 14:50

Mantenlo simple, solo agrega

#home-top-video:before {
    content: '';
    position: absolute;
    height: 100%;
    width: 100%;
    background: rgba(255,0,255,0.2); //Change as per your requirement
}
4
Zuber 24 feb. 2018 a las 12:21