Change background-color of html5 video element

大兔子大兔子 提交于 2019-12-22 03:51:11

问题


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.


回答1:


Try this CSS:

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



回答2:


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




回答3:


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

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


来源:https://stackoverflow.com/questions/19974902/change-background-color-of-html5-video-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!