Is there a way to keep a div centered and create white space around it when the browser window is resized? I want this effect to happen whether the browser window gets larger or smaller. Currently, when the window size decreases, the left side of the div locks in place, causing only a small portion of the image to be visible instead of keeping the center intact. Apologies if my question is a bit confusing, I'm still new to programming. Any guidance on this issue would be greatly appreciated. Thank you in advance! :)
p.s I'm also having trouble getting a video to play on the page, any assistance with that would be helpful too
Provided below is my current code:
body {
font-family: 'Noto Sans', sans-serif;
margin: 0;
padding: 0;
}
#page-container {
width: 1920px;
margin: auto;
}
<div id="page-container">
<video id="backgroundvid" width="auto" autoplay>
<source src="assets/video/portalAnimLowRes.mp4" type="video/mp4">
</video>
</div>