Instead of using a <p>
tag rather use a <div>
, as <ul>
and <li>
tags seem to always cause problems when it comes to their display properties (display:block
or inline
) when placed inside <p>
tags.
<div id="txth">
<ul>
<li id="snow">
<span class="title">Snow</span>
</li>
Hello
</ul>
<ul>
<li id="rain">
<span class="title">Rain</span>
</li>
Hello
</ul>
</div>
Im not sure about the sym
before the selector but this should work.
$(document).ready(function(){
var textHeight = $("#txth").css("height");
alert(textHeight);
});