DEV Community

Discussion on: How do you compensate the space that fixed header takes place in react?

Collapse
 
alexparra profile image
Alex Parra

have you tried position sticky instead of fixed?
Fixed position removes the element from the document flow while (if I’m not mistaken) sticky does not.
Which means the “space” it occupies is always there thus keeping subsequent elements in the right place.

Another option might be flex column on the wrapper with scrolling on the main area. But this needs some tweaks to scrolling overflow.

Collapse
 
raisaugat profile image
Saugat Rai

Yes, tried it and it worked smoothly. But is there any other alternatives also?
Thank you for the suggestions. :)