I'm facing a challenge in determining the actual height of an element, which currently has a CSS height property set to:
height: 0;
When I check the console, it shows a height of 0, but I'm looking to find the real height of the element.
I also attempted using:
$('nav').prop('scrollHeight');
as recommended by someone, but the height returned was slightly inaccurate.
The structure of my HTML is quite straightforward:
<nav>
<ul>
<li>
text 1
</li>
<li>
text 2
</li>
<li>
</li>
</ul>
</nav>
The CSS for this element is as follows:
nav {
height: 0;
margin: 0;
padding: 0;
display: block;
}
Any insights or suggestions on how I can accurately retrieve the height?