.container{ position: relative; width: 100%; height: 100vh; overflow: auto; } .container .section{ position: relative; width: 100%; height: 100%; } h1{ text-align: center; } .container .section:nth-child(1){ background-color: burlywood; } .container .section:nth-child(2){ background-color: black; }