Faisu0p
Faisu0p
KPCKevin Powell - Community
Created by Faisu0p on 11/19/2024 in #front-end
Content going upwards and out of viewport when adding new things below
When i add new content below ,the existing upper content goes out of the viewport from the top. I am not suing absolute positioning , using flex-column in the main container
return (

<div className="Container">
<div className="back">
<img src={bg_image} alt="" className="background-image" />
</div>
.
.
.
More content below , more divs i mean
</div>
return (

<div className="Container">
<div className="back">
<img src={bg_image} alt="" className="background-image" />
</div>
.
.
.
More content below , more divs i mean
</div>
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow-x: hidden;
}

.Container {
max-width: 100%;
margin: 0 auto;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
background-color: #ffffff;
min-height:100svh;
padding-top: 0;
}

.back {
position: relative;
width: 100%;
height: 500px;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}

.background-image {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
position: absolute;
top: 0;
left: 0;
transition: transform 0.5s ease;
}

.background-image:hover {
transform: scale(1.02);
}

.
.
.
.
.
More css
body, html {
margin: 0;
padding: 0;
height: 100%;
overflow-x: hidden;
}

.Container {
max-width: 100%;
margin: 0 auto;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
background-color: #ffffff;
min-height:100svh;
padding-top: 0;
}

.back {
position: relative;
width: 100%;
height: 500px;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
}

.background-image {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
position: absolute;
top: 0;
left: 0;
transition: transform 0.5s ease;
}

.background-image:hover {
transform: scale(1.02);
}

.
.
.
.
.
More css
48 replies