I have a div which contains 2 elements. First element is a span and second element is an
input, like:
<div id="container">
<span>FirstName</span>
<br />
<input type="text" />
</div>
The width of container div is set to 300px and I was expecting that it will automatically calculate its height according to its children’s height. Here it calculates its height, but it didn’t include the input element height.
What’s going on here?
EDIT
My container position : absolute and because of some reason i can’t set overflow : hidden
Here is working demo with jQuery – http://jsfiddle.net/dccF2/3/