Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

All you need is an `overflow-y: scroll` on the text element, and it will work as desired. The whole page won't have a scrollbar, because no content will be overflowing past it's boundaries.

Grid is ideal for these kind of layouts.



Thanks, that worked. Although I did still have to suppress the page scrollbar with "body { overflow-y: hidden; }" Not sure why.


Might need to use normalize or reset to deal with margin collapse, even then I’ve noticed the behavior at random times. The CSS box model is simple yet obtuse all at once.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: