I am trying to make a website that full the page with one color at the beginning part of the website, and when you scroll down, you will see different parts with different colors.
However, this code is not working and I can not scroll down.
I searched the internet and I found This. However, the CSS solution will leave a white part on the left, so I changed the code, but the current problem occurs.
.MAX{
width: 100vw;
height: 100vh;
left:0px;
margin:0px;
padding: 0px;
position:absolute;
}
<div class="MAX" style="background:red;">
</div>
<p>
I can not be shown
</p>
I want a CSS-only solution because I know little about Javascript.
2
Answers
You are using
position: absolute;
and that’s why you cannot see thep
element,position: relative;
will give you your desired resultsSince you mentioned wanting multiple sections, each with a different color, I’ll throw this out there too, as a simple example that you could build upon