Use height: auto
#accordion div:hover {
height:auto; /* THIS NEEDS TO ADJUST AUTOMATICALLY */
}
문제
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?
해결책
Use height: auto
#accordion div:hover {
height:auto; /* THIS NEEDS TO ADJUST AUTOMATICALLY */
}