We are currently building a website with html and css.
I would like to do the following:
For background images, you can easily create a full screen background by specifying the body element as
However, it is not possible to place the video on top of it with video elements.
What should I do to align the video with the background?
Is it strange to put the background together in the first place?
If so, what approach should I use to build it?
I would appreciate it if you could let me know.
Thank you for your cooperation.
It's not impossible to have even one background.The problem is that when you use
vh, and so on, but I think any recent browser will work.IE8 is not allowed.)
As you can see from the comments, the example uses media query to calculate differently if the aspect ratio of the window is larger than the aspect ratio of the background image (image magnification depends on window width).In order to show the switchover, red for width-dependent and green for height-dependent, translucent
div.If you change it to the
video tag, it will work as it is.
© 2022 OneMinuteCode. All rights reserved.