DEV Community

Discussion on: Understanding overflow in CSS

Collapse
 
jharteaga profile image
Jose Arteaga

Thanks for sharing with nice examples! I just have a doubt, let me put you an example:

I have two divs: First div is my NavBar and the Second div will be my content. My NavBar will have a fixed position, but I don't want that my content div scrolls behind the NavBar. Can I use "Scroll Overflow" in my content div, in order to allow scrolling only inside the content div without going behind the NavBar div?

Collapse
 
datmt profile image
Mạnh Đạt • Edited

Hi Jose,

That is possible. However, you need to set a fixed height for your content div.
Take a look at my example below. Is this what you want to achieve?

nav bar