Currently, I am dealing with some HTML/CSS aspects of an already established WordPress website. It appears that there might be an issue related to the theme's CSS causing this problem, although it is not immediately apparent.
Specifically, there is some CSS in place which defines the height of <li>
elements within the mobile navigation as height: auto;
. Despite the fact that the text inside the <li>
tags is 32px tall, the computed height of the <li>
itself is showing as 80px.
After checking for any padding and margins, it was determined that there were none present. This has left me puzzled as to how the height calculation is being derived.
A snippet of the code can be viewed here: https://codepen.io/kanekekoa/pen/OJdVyoP
I am reluctant to set a fixed height value explicitly (e.g., 32px). Are there any alternative methods I could utilize to ensure the height adjusts based on its contents?