Reputation: 8487
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
Upvotes: 0
Views: 285
Reputation: 4358
Try the following -
#container{
width:300px;
height:auto;
overflow:hidden;
}
Working DEMO
EDIT: added Position:absoulte
Updated DEMO
Upvotes: -1