jquery.height() and float parameter in CSS

kyleelectric

New Member
I'd noticed a strange behaviour of \[code\]jquery.height()\[/code\] function. Have a look at the following code.CSS: \[code\]div.text-field { font-family: sans-serif; margin: 3px; float: left;}\[/code\]HTML:\[code\]<div id="someid"> <div class="text-holder"> <div class="text-field">text here</div> </div></div>\[/code\]JS:\[code\]console.log($("someid").find("text-holder").height());\[/code\]The last line outputs \[code\]0\[/code\] if I have \[code\]float: left;\[/code\] in CSS file, and otputs real height if I remove \[code\]float: left;\[/code\]. What is the reason of such a behaviour? Can I use \[code\]height()\[/code\] function together with \[code\]float: left;\[/code\]?
 
Back
Top