height: 100%
gives the element 100% height of its parent container.
height: auto
means the element height will depend upon the height of its children.
Consider these examples:
height: 100%
<div style="height: 50px">
<div id="innerDiv" style="height: 100%">
</div>
</div>
#innerDiv
is going to have height: 50px
height: auto
<div style="height: 50px">
<div id="innerDiv" style="height: auto">
<div id="evenInner" style="height: 10px">
</div>
</div>
</div>
#innerDiv
is going to have height: 10px
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…