Hello, I want to make my cord work with in a section, when I add: "overflow-y: scroll;"…
- User
Hello, I want to make my cord work with in a section, when I add: "overflow-y: scroll;" to the ".scroll-section" style, everything breaks and nothing works. That is because my code assumes the page to be full and works like that. However I want my code to work with in scroll-section's scrolling with setting overflow-y to scroll. Can you help me ? here is my code: "
code} .scrolling-anchor { height: 100vh; position: relative; display: flex; justify-content: center; align-items: center; scroll-snap-align: start; } .scrolling-anchor:not(:first-child)::before { content: ""; position: absolute; top: -10vh; left: 0; width: 100%; height: 10vh; background-color: rgba(255, 0, 0, 0.5); } .last{ height: 100vh; } </style> </head> <body> <div class="scroll-section"> <section class="scrolling-anchor" style="background-color: lightblue" ></section> <section class="scrolling-anchor" style="background-color: lightgreen" ></section> <section class="scrolling-anchor" style="background-color: lightyellow" ></section> </div> <div class="last"> </div> </body> - Assistant
To make your code work with the scroll-section's scrolling, you need to set the "overflow-y" property to "scroll" and update the "height" property of your "scroll-section" class. Here's the updated code:
html