Objective: The header has a hamburger menu click, and once the hamburger is in an active state I want a full-page, will width div container where I can show my menu, etc.
↓
<div class="hamopen theme-width">
<p>Placeholder Text. Actual menus will be here when hmaburger is active</p>
</div>
I want the above div to be just below the header when the hamburger is active.
That makes no sense, That means the element will be 100vh and then positioned 100% down from its relative parent. That means it will be too big for the viewport.
I’d need to see the page (or a reduced demo) as there is too much going on to give a simple answer
Hi there, I give it a try with 2 positioning methods.
Attempt #1 with position :absolute
Associated css: hamburger.css nav under header as child
Attempt#2 with position:fixed
Associated css: hamburger-2.css nav is child to body now.
Certain challenges exist in both: fixed and absolute.
The header in the real-life situation will not have the same height, depending on the logo, the height may slightly vary. That why in position absolute example I sued top 100%, and it worked, but issues were:
absolute was not scrolling.
I moved to fixed position. In fixed positioning, I am facing an issue.
In position fixed, the header which holds that hamburger click is also not fixed so during a scroll that hamburger cross is lost.
Any chance of a reduced codepen so I can play around with it. It may also help to have the most simple version of what you are trying to achieve rather than try to fit it somewhere where it can’t work as you want. Once you have a basic demo then you can see how it can be made to work in more complicated situations.
The issue with those links is fixed now. There was no HTTP to HTTPS redirect so it was blacklisted. The issue is fixed now. In those versions I have reduced too much HTML
The fixed menu isn’t well thought out so we really need to know what effect you want to achieve? Ideally you would want the header fixed when the menu is open because the hamburger will scroll away.
Either attach the fixed nav to the bottom of the header html and then just fix the whole header when the hamburger is open and all will be ok. You then don’t have to worry about its position as it will be in the right place. You can set a max-height as in the other code to allow the header to scroll within itself.
Alternatively slide the hamburger from the left but push the page to the right while the hamburger is open. Include a close hamburger icon inside the fixed section so you can close it.
Alternatively include a logo and hamburger in the sliding section so that you can put it from top to bottom.
This seems to be more a design question so perhaps if you can explain what you want to happen it might make more sense.?