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?

Was it helpful?

Solution

Use height: auto

#accordion div:hover {
    height:auto; /* THIS NEEDS TO ADJUST AUTOMATICALLY */
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top