I
I
ItsCoder2018-02-19 11:20:08
css
ItsCoder, 2018-02-19 11:20:08

How to implement such a menu?

How to implement this type of menu?
VrwMPRRFOPEBB2.jpg
The menu itself should be in a container with a border.
The problem is that if the last level of the menu is set to position: absolute, then the parent container will not have a dynamic height and will change depending on the number of menu items.
What other solutions are there?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene Chefranov, 2018-02-19
@Chefranov

Try to give the last menu not absolute, but relative

M
Maxim, 2018-02-19
@Melagomania

I sketched it like this:
https://codepen.io/Melagomania/pen/MQQvgb?editors=0100
Of course, the solution is a hack and absolutely not universal, because the number of submenu elements can be different. Nevertheless, it is possible that in some particular case this method will do if it does not provide for the addition / deletion of sub-items, sub-menus. You can also set different margins at the bottom when hovering over different menu items, so that the height "adjusts".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question