0

I have a video which is set on full window height with this css style

width: auto;
height: 100vh;
min-height: 100%;
position: absolute;
background-attachment: fixed;
left: 0px;
object-fit: fill;
z-index: -1;
overflow: hidden;

but the problem is, that when i open it on mobile, the video is zoomed to left bottom corner. Is there any way how to zoom to center?

kores59
  • 443
  • 1
  • 5
  • 16
  • Unfortunately you don't provide any HTML, or simplified, minimalistic reproduction of your issue. Please do so. But my wild guess - based on your CSS - is that it has to do with `left: 0px`. – Daan Sep 17 '18 at 12:30
  • Possible duplicate of [How to horizontally center a
    in another
    ?](https://stackoverflow.com/questions/114543/how-to-horizontally-center-a-div-in-another-div)
    – Daan Sep 17 '18 at 12:34

1 Answers1

2

use

left: 50%;
transform: translateX(-50%);
  • You'll probably want to add the vertical aspect as well since OP problem is left **bottom** corner. – zer00ne Sep 17 '18 at 15:03