Question

I've got this accordion menu: Codepen link

The problem is that the height of the expanding divs is "hardcoded" (see where the css comment is), whereas I need it to expand according to the number of submenu items.

Any ideas how to fix this?

Était-ce utile?

La solution

Use height: auto

#accordion div:hover {
    height:auto; /* THIS NEEDS TO ADJUST AUTOMATICALLY */
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top