Are menus that expand when you hover your mouse over exclusively CSS?

Someone told me, as soon as you can create a menu only using CSS, how can you?

+3
source share
5 answers

This is done through a selector. You use a pseudo-class to indicate a specific element only to display when its parent element is in the know.

#nav li:hover > ul {
display: block;
}

This will only display ul if its parent, #nav is frozen. Ul is now a drop-down menu where you can place more list items. This will work with any number of levels that you want your drop-down menu to have.

: CSS3

+2

, , , . display: hidden , display: block .

+1
0

Google - css .

, Eric Meyers CSS.

-1

Source: https://habr.com/ru/post/1722234/


All Articles