'Hero section video overflowing (CSS/React)
How do you make a navbar and hero section that fills the height of the screen, and not scrollable?
Currently I am trying:
My nav css:
.NavStyle {
top: 0;
width: 100%;
position: absolute;
padding-left: 20px;
}
My Hero Section css:
.video-hero {
object-fit: cover;
width: 100%;
height: 100%;
position: fixed;
z-index: -1;
}
.hero-container {
color: aliceblue;
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.2);
object-fit: contain;
}
My App.js (note my app.css does not have any css):
<div className="App">
<MyNav />
<Hero />
<div className='project-container'>
Hello-Test
</div>
</div>
The issue is that the nav bar and hero section DO take the full height..but when I scroll down, the video is sort of repeating and flowing onto the "project-container"?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
