Stopping a drop down horizontal menu from pushing content down

I’m using javascript to show and hide (via display:none & block) a drop down horizontal menu. But it pushes my content down the page. Can I keep it in a set space so nothing moves when it shows up?

you need to set position: absolute for that drop down menu, and position: relative for it’s parent if needed. This will take drop down menu element from the flow of the page and it will be placed absolutely on the page position can be set by top, bottom, left, right css properties, or by javascript as well.

igv ++

In general, a good CSS dropdown menu uses position: absolute and pulls the subs offscreen with a ginormous negative left position or negative left margin, then brought onscreen with left: 0 or left: auto (depending). You can do this with Javascript too. Instead of changing the display state, change the left style coordinate.