I'm following a video to code a fully responsive website, but I can't seem to be able to make the background video full screen like in the video, maybe I'm missing a line of code? You'll see on the screenshot a big white space at the bottom. I'll leave some code below, hopefully that'll help to find the issue. Many thanks!
index.js:
return (
<HeroContainer>
<HeroBg>
<VideoBg autoPlay loop muted src={Video} type='video/mp4' />
</HeroBg>
<HeroContent>
<HeroH1>Estudio Contable</HeroH1>
<HeroP>
Consultá por nuestros servicios.
</HeroP>
<HeroBtnWrapper>
<Button
to='contactanos'
onMouseEnter={onHover}
onMouseLeave={onHover}
primary="true"
dark="true"
>
Contactanos {hover ? <ArrowForward /> : <ArrowRight />}
</Button>
</HeroBtnWrapper>
</HeroContent>
</HeroContainer>
)
}
styling:
export const HeroBg = styled.div`
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
`
export const VideoBg = styled.video`
width: 100%;
height: 100%;
-o-object-fit: cover;
object-fit: cover;
background: #232a34;
`
