質問

I've got the following website: beta.leifsigersen.com

There's a movie on the front page which sometimes takes a little while to load (sometimes less than a second, sometimes a few seconds). Before the movie is loaded there's black background/borders. How can I change the color of this?

I've tried to use CSS of the video-element, but without any luck.

役に立ちましたか?

解決

Try this CSS:

.pk_video {
     background-color: red !important; /* or whatever you want */
}

他のヒント

Just add the background color to the html code itself. For example:

<video width="100%" height="100%" style="background-color: #fff;" src=""></video>

So i had this annoying white bar, I got rid of it using. I applied it the the containing div.

background-color: transparent;

Alternatively use

 background-color: rgba(0, 0, 0, 0);

Hope that helps

I have used overlay content like so: Ionic/Angular

.html

<video autoplay muted loop playsinline preload="auto" onloadedmetadata="this.muted = true">
  <source [src]="video" type="video/mp4" />
</video>

<div class="overlay-content"></div>

.scss

 video {
     object-fit: cover;
     width: 100vw;
     height: 60vh;
     top: 0;
     left: 0;
     opacity: 0.5;
     -webkit-filter: blur(5px);
     -moz-filter: blur(5px);
     -o-filter: blur(5px);
     -ms-filter: blur(5px);
     filter: blur(5px);
 }

 .overlay-content {
     position: absolute;
     top: 0;
     left: 0;
     background: rgba(6, 56, 82, 0.5);
     width: 100vw;
     height: 60vh;
 }
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top