Confused on how to approach this Layout
Hello. Hope you are having an amazing week.
PROJECT EXPLANATION
I was looking for website inspiration to learn new things and came across this site: https://www.wallofportfolios.in/portfolios/ayaneshu-bhardwaj/ and I wanted to give it a try but on a different setup.
Instead of having it as a sidebar, my navbar will be on top.
The content will be inside the GREY AREA and should have a fixed margin from both the top and bottom. exactly the same, so it accounts for the header height.
MY PROBLEM @_@
I just cannot seem to understand how to approach this layout. Tried using 100vh but either I am doing it wrongly or is not the right approach.
Content will stay inside the square, and will be scrollable INSIDE the square, but without scrollbars.
5 Replies
Result should be this.
So, something like this.

This could be achieved in several ways.
One method would be to give the main element a fixed position with an inset (top, right, bottom, right) position of X (where X = the margin) and an overflow of
scroll.
Likewise the "nav" element would also have a position fixed, it's height being X, ie the same as the margin set for the main element to ensure that it doesn't overlap.
You can hide the scrollbars with CSS for most browsers with something like this:
I have a demo of this on Codepen if you would like to see it in more detail.@Chris Bolson@StefanH
Sorry for the delay, I had a really horrible and busy day.
Anyway, thanks a lot, this was really helpful!
Wish you a wonderful day/week.