I
I
Ivan Bogatov2018-03-21 22:05:23
css
Ivan Bogatov, 2018-03-21 22:05:23

How to create a real drop down menu?

The key difference is that the submenu does not get visibility, but floats out from under the menu item, with 2 from under 1, 3 from under 2, and so on.
In general, this is not difficult, but it seems to me that I am doing it too complicated: firstly, I assign to each menu rank its own class (SubmenuElementRung) smer1, smer2 ... so that each of them has its own z-index (because in the standard below the written menu item is drawn ABOVE the previous one), and so that each of them floats away when hovering at its distance; and secondly, I don't like the idea of ​​assigning a different z-index to each rank.
Perhaps there is already an implemented version or just masthead thoughts, how to simplify mine?
https://jsfiddle.net/w9yzw5ts/

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor Zhivagin, 2018-03-21
@Krasnodar_etc

Throw the code into the sandbox like jsfiddle / codepen , ... So nifiga is not clear)

V
Varlam, 2018-03-22
Erofeich @warsand

I may not be an expert, but " display: none; " helps me. There are experiments:
Animated icon
Switchable tabs
CSS dropdowns

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question